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

Function size

test/3rdparty/angular-1.2.5.js:698–710  ·  view source on GitHub ↗

* @description * Determines the number of elements in an array, the number of properties an object has, or * the length of a string. * * Note: This function is used to augment the Object type in Angular expressions. See * angular.Object for more information about Angular arrays. * * @

(obj, ownPropsOnly)

Source from the content-addressed store, hash-verified

696 * @returns {number} The size of `obj` or `0` if `obj` is neither an object nor an array.
697 */
698function size(obj, ownPropsOnly) {
699 var count = 0, key;
700
701 if (isArray(obj) || isString(obj)) {
702 return obj.length;
703 } else if (isObject(obj)){
704 for (key in obj)
705 if (!ownPropsOnly || obj.hasOwnProperty(key))
706 count++;
707 }
708
709 return count;
710}
711
712
713function includes(array, obj) {

Callers

nothing calls this directly

Calls 3

isArrayFunction · 0.85
isStringFunction · 0.85
isObjectFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…