mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
Simplify _.size.
This commit is contained in:
@@ -9403,11 +9403,9 @@
|
|||||||
if (isArrayLike(collection)) {
|
if (isArrayLike(collection)) {
|
||||||
return isString(collection) ? stringSize(collection) : collection.length;
|
return isString(collection) ? stringSize(collection) : collection.length;
|
||||||
}
|
}
|
||||||
if (isObjectLike(collection)) {
|
var tag = getTag(collection);
|
||||||
var tag = getTag(collection);
|
if (tag == mapTag || tag == setTag) {
|
||||||
if (tag == mapTag || tag == setTag) {
|
return collection.size;
|
||||||
return collection.size;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return baseKeys(collection).length;
|
return baseKeys(collection).length;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user