Bump to v4.15.0.

This commit is contained in:
John-David Dalton
2016-08-11 23:29:12 -07:00
parent cbf5cb1162
commit 28663c1e27
54 changed files with 344 additions and 217 deletions

14
size.js
View File

@@ -1,7 +1,6 @@
import baseKeys from './_baseKeys.js';
import getTag from './_getTag.js';
import isArrayLike from './isArrayLike.js';
import isObjectLike from './isObjectLike.js';
import isString from './isString.js';
import stringSize from './_stringSize.js';
@@ -17,7 +16,7 @@ var mapTag = '[object Map]',
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Array|Object|string} collection The collection to inspect.
* @returns {number} Returns the collection size.
* @example
*
@@ -35,14 +34,11 @@ function size(collection) {
return 0;
}
if (isArrayLike(collection)) {
var result = collection.length;
return (result && isString(collection)) ? stringSize(collection) : result;
return isString(collection) ? stringSize(collection) : collection.length;
}
if (isObjectLike(collection)) {
var tag = getTag(collection);
if (tag == mapTag || tag == setTag) {
return collection.size;
}
var tag = getTag(collection);
if (tag == mapTag || tag == setTag) {
return collection.size;
}
return baseKeys(collection).length;
}