MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / isArrayLike

Function isArrayLike

web/static/bower_components/angular/angular.js:269–284  ·  view source on GitHub ↗

* @private * @param {*} obj * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, * String ...)

(obj)

Source from the content-addressed store, hash-verified

267 * String ...)
268 */
269function isArrayLike(obj) {
270 if (obj == null || isWindow(obj)) {
271 return false;
272 }
273
274 // Support: iOS 8.2 (not reproducible in simulator)
275 // "length" in obj used to prevent JIT error (gh-11508)
276 var length = "length" in Object(obj) && obj.length;
277
278 if (obj.nodeType === NODE_TYPE_ELEMENT && length) {
279 return true;
280 }
281
282 return isString(obj) || isArray(obj) || length === 0 ||
283 typeof length === 'number' && length > 0 && (length - 1) in obj;
284}
285
286/**
287 * @ngdoc function

Callers 7

forEachFunction · 0.85
$watchCollectionActionFunction · 0.85
filterFilterFunction · 0.85
orderByFilterFunction · 0.85
getOptionValuesKeysFunction · 0.85
angular.jsFile · 0.85

Calls 2

isWindowFunction · 0.85
isStringFunction · 0.85

Tested by

no test coverage detected