mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57: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);
|
result = hasFunc(object, path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result || (isLength(object && object.length) && isIndex(path, object.length) &&
|
var length = object ? object.length : undefined;
|
||||||
(isArray(object) || isString(object) || isArguments(object)));
|
return result || (
|
||||||
|
!!length && isLength(length) && isIndex(path, length) &&
|
||||||
|
(isArray(object) || isString(object) || isArguments(object))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -5012,9 +5015,11 @@
|
|||||||
*/
|
*/
|
||||||
function indexKeys(object) {
|
function indexKeys(object) {
|
||||||
var length = object ? object.length : undefined;
|
var length = object ? object.length : undefined;
|
||||||
return (isLength(length) && (isArray(object) || isString(object) || isArguments(object)))
|
if (isLength(length) &&
|
||||||
? baseTimes(length, String)
|
(isArray(object) || isString(object) || isArguments(object))) {
|
||||||
: null;
|
return baseTimes(length, String);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -9551,7 +9556,7 @@
|
|||||||
*/
|
*/
|
||||||
function isEmpty(value) {
|
function isEmpty(value) {
|
||||||
if (isArrayLike(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;
|
return !value.length;
|
||||||
}
|
}
|
||||||
for (var key in value) {
|
for (var key in value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user