mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Use isLength in _.keys, _.keysIn, and shimKeys.
This commit is contained in:
@@ -3807,7 +3807,7 @@
|
|||||||
length = propsLength && object.length,
|
length = propsLength && object.length,
|
||||||
support = lodash.support;
|
support = lodash.support;
|
||||||
|
|
||||||
var allowIndexes = typeof length == 'number' && length > 0 &&
|
var allowIndexes = length && isLength(length) &&
|
||||||
(isArray(object) || (support.nonEnumStrings && isString(object)) ||
|
(isArray(object) || (support.nonEnumStrings && isString(object)) ||
|
||||||
(support.nonEnumArgs && isArguments(object)));
|
(support.nonEnumArgs && isArguments(object)));
|
||||||
|
|
||||||
@@ -8530,8 +8530,7 @@
|
|||||||
length = object.length;
|
length = object.length;
|
||||||
}
|
}
|
||||||
if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
|
if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
|
||||||
(typeof length == 'number' && length > 0) ||
|
(typeof object == 'function' ? lodash.support.enumPrototypes : (length && isLength(length)))) {
|
||||||
(lodash.support.enumPrototypes && typeof object == 'function')) {
|
|
||||||
return shimKeys(object);
|
return shimKeys(object);
|
||||||
}
|
}
|
||||||
return isObject(object) ? nativeKeys(object) : [];
|
return isObject(object) ? nativeKeys(object) : [];
|
||||||
@@ -8567,7 +8566,7 @@
|
|||||||
var length = object.length,
|
var length = object.length,
|
||||||
support = lodash.support;
|
support = lodash.support;
|
||||||
|
|
||||||
length = (typeof length == 'number' && length > 0 &&
|
length = (length && isLength(length) &&
|
||||||
(isArray(object) || (support.nonEnumStrings && isString(object)) ||
|
(isArray(object) || (support.nonEnumStrings && isString(object)) ||
|
||||||
(support.nonEnumArgs && isArguments(object))) && length) || 0;
|
(support.nonEnumArgs && isArguments(object))) && length) || 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user