mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Bump to v4.11.2.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
var castPath = require('./_castPath'),
|
||||
has = require('./has'),
|
||||
var baseHas = require('./_baseHas'),
|
||||
castPath = require('./_castPath'),
|
||||
isKey = require('./_isKey'),
|
||||
last = require('./last'),
|
||||
parent = require('./_parent');
|
||||
parent = require('./_parent'),
|
||||
toKey = require('./_toKey');
|
||||
|
||||
/**
|
||||
* The base implementation of `_.unset`.
|
||||
@@ -15,8 +16,9 @@ var castPath = require('./_castPath'),
|
||||
function baseUnset(object, path) {
|
||||
path = isKey(path, object) ? [path] : castPath(path);
|
||||
object = parent(object, path);
|
||||
var key = last(path);
|
||||
return (object != null && has(object, key)) ? delete object[key] : true;
|
||||
|
||||
var key = toKey(last(path));
|
||||
return !(object != null && baseHas(object, key)) || delete object[key];
|
||||
}
|
||||
|
||||
module.exports = baseUnset;
|
||||
|
||||
Reference in New Issue
Block a user