mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Move isObjectLike condition up in _.isEmpty.
This commit is contained in:
10
lodash.js
10
lodash.js
@@ -10399,17 +10399,17 @@
|
|||||||
isArguments(value) || isBuffer(value))) {
|
isArguments(value) || isBuffer(value))) {
|
||||||
return !value.length;
|
return !value.length;
|
||||||
}
|
}
|
||||||
for (var key in value) {
|
|
||||||
if (hasOwnProperty.call(value, key)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isObjectLike(value)) {
|
if (isObjectLike(value)) {
|
||||||
var tag = getTag(value);
|
var tag = getTag(value);
|
||||||
if (tag == mapTag || tag == setTag) {
|
if (tag == mapTag || tag == setTag) {
|
||||||
return !value.size;
|
return !value.size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (var key in value) {
|
||||||
|
if (hasOwnProperty.call(value, key)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user