source: imaps-frontend/node_modules/lodash-es/_baseUnset.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 578 bytes
Line 
1import castPath from './_castPath.js';
2import last from './last.js';
3import parent from './_parent.js';
4import toKey from './_toKey.js';
5
6/**
7 * The base implementation of `_.unset`.
8 *
9 * @private
10 * @param {Object} object The object to modify.
11 * @param {Array|string} path The property path to unset.
12 * @returns {boolean} Returns `true` if the property is deleted, else `false`.
13 */
14function baseUnset(object, path) {
15 path = castPath(path, object);
16 object = parent(object, path);
17 return object == null || delete object[toKey(last(path))];
18}
19
20export default baseUnset;
Note: See TracBrowser for help on using the repository browser.