MCPcopy Create free account
hub / github.com/apache/cloudstack / size

Function size

tools/ngui/static/js/lib/angular.js:506–518  ·  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

504 * @returns {number} The size of `obj` or `0` if `obj` is neither an object nor an array.
505 */
506function size(obj, ownPropsOnly) {
507 var size = 0, key;
508
509 if (isArray(obj) || isString(obj)) {
510 return obj.length;
511 } else if (isObject(obj)){
512 for (key in obj)
513 if (!ownPropsOnly || obj.hasOwnProperty(key))
514 size++;
515 }
516
517 return size;
518}
519
520
521function 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