MCPcopy
hub / github.com/layui/layui / isArrayLike

Function isArrayLike

src/modules/jquery.js:549–566  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

547 );
548
549 function isArrayLike(obj) {
550 // Support: real iOS 8.2 only (not reproducible in simulator)
551 // `in` check used to prevent JIT error (gh-2145)
552 // hasOwn isn't used here due to false negatives
553 // regarding Nodelist length in IE
554 var length = !!obj && 'length' in obj && obj.length,
555 type = toType(obj);
556
557 if (isFunction(obj) || isWindow(obj)) {
558 return false;
559 }
560
561 return (
562 type === 'array' ||
563 length === 0 ||
564 (typeof length === 'number' && length > 0 && length - 1 in obj)
565 );
566 }
567
568 function nodeName(elem, name) {
569 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();

Callers 1

jquery.jsFile · 0.85

Calls 3

toTypeFunction · 0.85
isFunctionFunction · 0.85
isWindowFunction · 0.85

Tested by

no test coverage detected