source: node_modules/es-toolkit/dist/compat/object/unset.d.ts

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 654 bytes
Line 
1/**
2 * Removes the property at the given path of the object.
3 *
4 * @param {unknown} obj - The object to modify.
5 * @param {PropertyKey | readonly PropertyKey[]} path - The path of the property to unset.
6 * @returns {boolean} - Returns true if the property is deleted, else false.
7 *
8 * @example
9 * const obj = { a: { b: { c: 42 } } };
10 * unset(obj, 'a.b.c'); // true
11 * console.log(obj); // { a: { b: {} } }
12 *
13 * @example
14 * const obj = { a: { b: { c: 42 } } };
15 * unset(obj, ['a', 'b', 'c']); // true
16 * console.log(obj); // { a: { b: {} } }
17 */
18declare function unset(obj: any, path: PropertyKey | readonly PropertyKey[]): boolean;
19
20export { unset };
Note: See TracBrowser for help on using the repository browser.