mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Simplify _.isEmpty.
This commit is contained in:
12
lodash.js
12
lodash.js
@@ -6238,14 +6238,10 @@
|
|||||||
if (!value) {
|
if (!value) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
var className = toString.call(value),
|
var length = value.length;
|
||||||
length = value.length;
|
if (length > -1 && length <= maxSafeInteger &&
|
||||||
|
(isArray(value) || isString(value) || isArguments(value) ||
|
||||||
if (length > -1 && length <= maxSafeInteger && (
|
(typeof value == 'object' && isFunction(value.splice)))) {
|
||||||
(className == arrayClass || className == stringClass ||
|
|
||||||
(support.argsClass ? className == argsClass : isArguments(value))) ||
|
|
||||||
(className == objectClass && isFunction(value.splice))
|
|
||||||
)) {
|
|
||||||
return !length;
|
return !length;
|
||||||
}
|
}
|
||||||
baseForOwn(value, function() {
|
baseForOwn(value, function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user