MCPcopy Create free account
hub / github.com/ampproject/amphtml / isArraylike

Function isArraylike

third_party/inputmask/inputmask.dependencyLib.js:22–31  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

20 return obj != null && obj === obj.window;
21 }
22 function isArraylike(obj) {
23 var length = "length" in obj && obj.length, ltype = typeof obj;
24 if (ltype === "function" || isWindow(obj)) {
25 return false;
26 }
27 if (obj.nodeType === 1 && length) {
28 return true;
29 }
30 return ltype === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj;
31 }
32 function isValidElement(elem) {
33 return elem instanceof window.Element;
34 }

Callers 1

factoryFunction · 0.85

Calls 1

isWindowFunction · 0.85

Tested by

no test coverage detected