mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Bump to v4.14.2.
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
var baseHas = require('./_baseHas'),
|
||||
castPath = require('./_castPath'),
|
||||
var castPath = require('./_castPath'),
|
||||
isKey = require('./_isKey'),
|
||||
last = require('./last'),
|
||||
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`.
|
||||
*
|
||||
@@ -18,7 +23,7 @@ function baseUnset(object, path) {
|
||||
object = parent(object, path);
|
||||
|
||||
var key = toKey(last(path));
|
||||
return !(object != null && baseHas(object, key)) || delete object[key];
|
||||
return !(object != null && hasOwnProperty.call(object, key)) || delete object[key];
|
||||
}
|
||||
|
||||
module.exports = baseUnset;
|
||||
|
||||
Reference in New Issue
Block a user