MCPcopy
hub / github.com/binux/qiandao / size

Function size

web/static/components/angularjs/angular.js:749–761  ·  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

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