tdesign-react
Version:
TDesign Component for React
41 lines (35 loc) • 1.07 kB
JavaScript
/**
* tdesign v1.15.1
* (c) 2025 tdesign
* @license MIT
*/
;
var _baseGet = require('./dep-3398c1f2.js');
var last = require('./dep-d915c90f.js');
var _baseSlice = require('./dep-7a148045.js');
/**
* Gets the parent value at `path` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent(object, path) {
return path.length < 2 ? object : _baseGet.baseGet(object, _baseSlice.baseSlice(path, 0, -1));
}
/**
* The base implementation of `_.unset`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The property path to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset(object, path) {
path = _baseGet.castPath(path, object);
object = parent(object, path);
return object == null || delete object[_baseGet.toKey(last.last(path))];
}
exports.baseUnset = baseUnset;
//# sourceMappingURL=dep-9a375a19.js.map