Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / _baseUnset.js
1 var baseToPath = require('./_baseToPath'),
2     has = require('./has'),
3     isKey = require('./_isKey'),
4     last = require('./last'),
5     parent = require('./_parent');
6
7 /**
8  * The base implementation of `_.unset`.
9  *
10  * @private
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`.
14  */
15 function baseUnset(object, path) {
16   path = isKey(path, object) ? [path + ''] : baseToPath(path);
17   object = parent(object, path);
18   var key = last(path);
19   return (object != null && has(object, key)) ? delete object[key] : true;
20 }
21
22 module.exports = baseUnset;