1 var baseToPath = require('./_baseToPath'),
2 has = require('./has'),
3 isKey = require('./_isKey'),
4 last = require('./last'),
5 parent = require('./_parent');
8 * The base implementation of `_.unset`.
11 * @param {Object} object The object to modify.
12 * @param {Array|string} path The path of the property to unset.
13 * @returns {boolean} Returns `true` if the property is deleted, else `false`.
15 function baseUnset(object, path) {
16 path = isKey(path, object) ? [path + ''] : baseToPath(path);
17 object = parent(object, path);
19 return (object != null && has(object, key)) ? delete object[key] : true;
22 module.exports = baseUnset;