mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
30
react-app/node_modules/lodash/collection/size.js
generated
vendored
Normal file
30
react-app/node_modules/lodash/collection/size.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
var getLength = require('../internal/getLength'),
|
||||
isLength = require('../internal/isLength'),
|
||||
keys = require('../object/keys');
|
||||
|
||||
/**
|
||||
* Gets the size of `collection` by returning its length for array-like
|
||||
* values or the number of own enumerable properties for objects.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collection
|
||||
* @param {Array|Object|string} collection The collection to inspect.
|
||||
* @returns {number} Returns the size of `collection`.
|
||||
* @example
|
||||
*
|
||||
* _.size([1, 2, 3]);
|
||||
* // => 3
|
||||
*
|
||||
* _.size({ 'a': 1, 'b': 2 });
|
||||
* // => 2
|
||||
*
|
||||
* _.size('pebbles');
|
||||
* // => 7
|
||||
*/
|
||||
function size(collection) {
|
||||
var length = collection ? getLength(collection) : 0;
|
||||
return isLength(length) ? length : keys(collection).length;
|
||||
}
|
||||
|
||||
module.exports = size;
|
Reference in New Issue
Block a user