Security update for permissions_by_term
[yaffs-website] / node_modules / uncss / node_modules / lodash / unset.js
1 var baseUnset = require('./internal/baseUnset');
2
3 /**
4  * Removes the property at `path` of `object`.
5  *
6  * @static
7  * @memberOf _
8  * @category Object
9  * @param {Object} object The object to modify.
10  * @param {Array|string} path The path of the property to unset.
11  * @returns {boolean} Returns `true` if the property is deleted, else `false`.
12  * @example
13  *
14  * var object = { 'a': [{ 'b': { 'c': 7 } }] };
15  * _.unset(object, 'a[0].b.c');
16  * // => true
17  *
18  * console.log(object);
19  * // => { 'a': [{ 'b': {} }] };
20  *
21  * _.unset(object, 'a[0].b.c');
22  * // => true
23  *
24  * console.log(object);
25  * // => { 'a': [{ 'b': {} }] };
26  */
27 function unset(object, path) {
28   return object == null ? true : baseUnset(object, path);
29 }
30
31 module.exports = unset;