mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
Bump to v4.14.2.
This commit is contained in:
26
keysIn.js
26
keysIn.js
@@ -1,10 +1,4 @@
|
||||
define(['./_baseKeysIn', './_indexKeys', './_isIndex', './_isPrototype'], function(baseKeysIn, indexKeys, isIndex, isPrototype) {
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
define(['./_arrayLikeKeys', './_baseKeysIn', './isArrayLike'], function(arrayLikeKeys, baseKeysIn, isArrayLike) {
|
||||
|
||||
/**
|
||||
* Creates an array of the own and inherited enumerable property names of `object`.
|
||||
@@ -30,23 +24,7 @@ define(['./_baseKeysIn', './_indexKeys', './_isIndex', './_isPrototype'], functi
|
||||
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
|
||||
*/
|
||||
function keysIn(object) {
|
||||
var index = -1,
|
||||
isProto = isPrototype(object),
|
||||
props = baseKeysIn(object),
|
||||
propsLength = props.length,
|
||||
indexes = indexKeys(object),
|
||||
skipIndexes = !!indexes,
|
||||
result = indexes || [],
|
||||
length = result.length;
|
||||
|
||||
while (++index < propsLength) {
|
||||
var key = props[index];
|
||||
if (!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
|
||||
!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
||||
result.push(key);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
|
||||
}
|
||||
|
||||
return keysIn;
|
||||
|
||||
Reference in New Issue
Block a user