MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / isMomentInputObject

Function isMomentInputObject

tests/test_code/js/moment/moment.js:3634–3672  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

3632 }
3633
3634 function isMomentInputObject(input) {
3635 var objectTest = isObject(input) && !isObjectEmpty(input),
3636 propertyTest = false,
3637 properties = [
3638 'years',
3639 'year',
3640 'y',
3641 'months',
3642 'month',
3643 'M',
3644 'days',
3645 'day',
3646 'd',
3647 'dates',
3648 'date',
3649 'D',
3650 'hours',
3651 'hour',
3652 'h',
3653 'minutes',
3654 'minute',
3655 'm',
3656 'seconds',
3657 'second',
3658 's',
3659 'milliseconds',
3660 'millisecond',
3661 'ms',
3662 ],
3663 i,
3664 property;
3665
3666 for (i = 0; i < properties.length; i += 1) {
3667 property = properties[i];
3668 propertyTest = propertyTest || hasOwnProp(input, property);
3669 }
3670
3671 return objectTest && propertyTest;
3672 }
3673
3674 function isNumberOrStringArray(input) {
3675 var arrayTest = isArray(input),

Callers 1

isMomentInputFunction · 0.85

Calls 3

isObjectFunction · 0.85
isObjectEmptyFunction · 0.85
hasOwnPropFunction · 0.85

Tested by

no test coverage detected