MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / isArrayLike

Function isArrayLike

lib/test/angular/1.6.7/angular.js:338–358  ·  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

336 * String ...)
337 */
338function isArrayLike(obj) {
339
340 // `null`, `undefined` and `window` are not array-like
341 if (obj == null || isWindow(obj)) return false;
342
343 // arrays, strings and jQuery/jqLite objects are array like
344 // * jqLite is either the jQuery or jqLite constructor function
345 // * we have to check the existence of jqLite first as this method is called
346 // via the forEach method when constructing the jqLite object in the first place
347 if (isArray(obj) || isString(obj) || (jqLite && obj instanceof jqLite)) return true;
348
349 // Support: iOS 8.2 (not reproducible in simulator)
350 // "length" in obj used to prevent JIT error (gh-11508)
351 var length = 'length' in Object(obj) && obj.length;
352
353 // NodeList objects (with `item` method) and
354 // other objects with suitable length characteristics are array-like
355 return isNumber(length) &&
356 (length >= 0 && ((length - 1) in obj || obj instanceof Array) || typeof obj.item === 'function');
357
358}
359
360/**
361 * @ngdoc function

Callers 8

forEachFunction · 0.70
$watchCollectionActionFunction · 0.70
filterFilterFunction · 0.70
limitToFilterFunction · 0.70
orderByFilterFunction · 0.70
getOptionValuesKeysFunction · 0.70
angular.jsFile · 0.70

Calls 4

isWindowFunction · 0.70
isStringFunction · 0.70
isNumberFunction · 0.70
isArrayFunction · 0.50

Tested by

no test coverage detected