mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
Avoid nullish being treated as plain objects in _.keysIn.
This commit is contained in:
@@ -6999,8 +6999,9 @@
|
||||
* // => ['x', 'y', 'z'] (property order is not guaranteed across environments)
|
||||
*/
|
||||
function keysIn(object) {
|
||||
object = Object(object);
|
||||
|
||||
if (object == null) {
|
||||
return [];
|
||||
}
|
||||
var length = object.length;
|
||||
length = (typeof length == 'number' && length > 0 &&
|
||||
(isArray(object) || (support.nonEnumStrings && isString(object)) ||
|
||||
|
||||
Reference in New Issue
Block a user