mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Bump to v4.17.2.
This commit is contained in:
@@ -3,12 +3,6 @@ var castPath = require('./_castPath'),
|
||||
parent = require('./_parent'),
|
||||
toKey = require('./_toKey');
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.unset`.
|
||||
*
|
||||
@@ -20,8 +14,7 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
function baseUnset(object, path) {
|
||||
path = castPath(path, object);
|
||||
object = parent(object, path);
|
||||
var key = toKey(last(path));
|
||||
return !(object != null && hasOwnProperty.call(object, key)) || delete object[key];
|
||||
return object == null || delete object[toKey(last(path))];
|
||||
}
|
||||
|
||||
module.exports = baseUnset;
|
||||
|
||||
Reference in New Issue
Block a user