MCPcopy
hub / github.com/angular-ui/ui-router / isArrayLike

Function isArrayLike

test/angular/1.3/angular.js:259–274  ·  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

257 * String ...)
258 */
259function isArrayLike(obj) {
260 if (obj == null || isWindow(obj)) {
261 return false;
262 }
263
264 // Support: iOS 8.2 (not reproducible in simulator)
265 // "length" in obj used to prevent JIT error (gh-11508)
266 var length = "length" in Object(obj) && obj.length;
267
268 if (obj.nodeType === NODE_TYPE_ELEMENT && length) {
269 return true;
270 }
271
272 return isString(obj) || isArray(obj) || length === 0 ||
273 typeof length === 'number' && length > 0 && (length - 1) in obj;
274}
275
276/**
277 * @ngdoc function

Callers 5

forEachFunction · 0.70
$watchCollectionActionFunction · 0.70
orderByFilterFunction · 0.70
angular.jsFile · 0.70

Calls 3

isArrayFunction · 0.85
isWindowFunction · 0.70
isStringFunction · 0.70

Tested by

no test coverage detected