MCPcopy
hub / github.com/jquery/esprima / isArrayLike

Function isArrayLike

test/3rdparty/angular-1.2.5.js:248–261  ·  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

246 * String ...)
247 */
248function isArrayLike(obj) {
249 if (obj == null || isWindow(obj)) {
250 return false;
251 }
252
253 var length = obj.length;
254
255 if (obj.nodeType === 1 && length) {
256 return true;
257 }
258
259 return isString(obj) || isArray(obj) || length === 0 ||
260 typeof length === 'number' && length > 0 && (length - 1) in obj;
261}
262
263/**
264 * @ngdoc function

Callers 3

forEachFunction · 0.85
$watchCollectionWatchFunction · 0.85
angular-1.2.5.jsFile · 0.85

Calls 3

isWindowFunction · 0.85
isStringFunction · 0.85
isArrayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…