UNPKG

tdesign-react

Version:
41 lines (35 loc) 1.07 kB
/** * tdesign v1.13.2 * (c) 2025 tdesign * @license MIT */ 'use strict'; var _baseGet = require('./dep-4ba2ac6b.js'); var last = require('./dep-e6a14ce7.js'); var _baseSlice = require('./dep-05b4c661.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-1843e637.js.map