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

Function isArrayLike

test/angular/1.2/angular.js:268–281  ·  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

266 * String ...)
267 */
268function isArrayLike(obj) {
269 if (obj == null || isWindow(obj)) {
270 return false;
271 }
272
273 var length = obj.length;
274
275 if (obj.nodeType === 1 && length) {
276 return true;
277 }
278
279 return isString(obj) || isArray(obj) || length === 0 ||
280 typeof length === 'number' && length > 0 && (length - 1) in obj;
281}
282
283/**
284 * @ngdoc function

Callers 5

forEachFunction · 0.70
$watchCollectionWatchFunction · 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