mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Cleanup hasPath and indexKeys.
This commit is contained in:
17
lodash.js
17
lodash.js
@@ -4922,8 +4922,11 @@
|
||||
result = hasFunc(object, path);
|
||||
}
|
||||
}
|
||||
return result || (isLength(object && object.length) && isIndex(path, object.length) &&
|
||||
(isArray(object) || isString(object) || isArguments(object)));
|
||||
var length = object ? object.length : undefined;
|
||||
return result || (
|
||||
!!length && isLength(length) && isIndex(path, length) &&
|
||||
(isArray(object) || isString(object) || isArguments(object))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5012,9 +5015,11 @@
|
||||
*/
|
||||
function indexKeys(object) {
|
||||
var length = object ? object.length : undefined;
|
||||
return (isLength(length) && (isArray(object) || isString(object) || isArguments(object)))
|
||||
? baseTimes(length, String)
|
||||
: null;
|
||||
if (isLength(length) &&
|
||||
(isArray(object) || isString(object) || isArguments(object))) {
|
||||
return baseTimes(length, String);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9551,7 +9556,7 @@
|
||||
*/
|
||||
function isEmpty(value) {
|
||||
if (isArrayLike(value) &&
|
||||
(isArray(value) || isString(value) || isArguments(value) || isFunction(value.splice))) {
|
||||
(isArray(value) || isString(value) || isFunction(value.splice) || isArguments(value))) {
|
||||
return !value.length;
|
||||
}
|
||||
for (var key in value) {
|
||||
|
||||
Reference in New Issue
Block a user