MCPcopy Index your code
hub / github.com/deployd/deployd / size

Function size

test-app/public/sinon.js:20469–20481  ·  view source on GitHub ↗

* Gets the size of `collection` by returning its length for array-like * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|s

(collection)

Source from the content-addressed store, hash-verified

20467 * // => 7
20468 */
20469 function size(collection) {
20470 if (collection == null) {
20471 return 0;
20472 }
20473 if (isArrayLike(collection)) {
20474 return isString(collection) ? stringSize(collection) : collection.length;
20475 }
20476 var tag = getTag(collection);
20477 if (tag == mapTag || tag == setTag) {
20478 return collection.size;
20479 }
20480 return baseKeys(collection).length;
20481 }
20482
20483 /**
20484 * Checks if `predicate` returns truthy for **any** element of `collection`.

Callers

nothing calls this directly

Calls 4

isArrayLikeFunction · 0.85
stringSizeFunction · 0.85
baseKeysFunction · 0.85
isStringFunction · 0.70

Tested by

no test coverage detected