MCPcopy Index your code
hub / github.com/angular-ui/ui-router / size

Function size

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

749 * @returns {number} The size of `obj` or `0` if `obj` is neither an object nor an array.
750 */
751function size(obj, ownPropsOnly) {
752 var count = 0, key;
753
754 if (isArray(obj) || isString(obj)) {
755 return obj.length;
756 } else if (isObject(obj)) {
757 for (key in obj)
758 if (!ownPropsOnly || obj.hasOwnProperty(key))
759 count++;
760 }
761
762 return count;
763}
764
765
766function includes(array, obj) {

Callers

nothing calls this directly

Calls 3

isArrayFunction · 0.85
isStringFunction · 0.70
isObjectFunction · 0.70

Tested by

no test coverage detected