source: node_modules/es-toolkit/dist/compat/object/omit.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: 1.7 KB
Line 
1import { Many } from '../_internal/Many.js';
2
3/**
4 * Creates a new object with specified keys omitted.
5 *
6 * @template T - The type of object.
7 * @template K - The type of keys to omit.
8 * @param {T | null | undefined} object - The object to omit keys from.
9 * @param {...K} paths - The keys to be omitted from the object.
10 * @returns {Pick<T, Exclude<keyof T, K[number]>>} A new object with the specified keys omitted.
11 *
12 * @example
13 * omit({ a: 1, b: 2, c: 3 }, 'a', 'c');
14 * // => { b: 2 }
15 */
16declare function omit<T extends object, K extends PropertyKey[]>(object: T | null | undefined, ...paths: K): Pick<T, Exclude<keyof T, K[number]>>;
17/**
18 * Creates a new object with specified keys omitted.
19 *
20 * @template T - The type of object.
21 * @template K - The type of keys to omit.
22 * @param {T | null | undefined} object - The object to omit keys from.
23 * @param {...Array<Many<K>>} paths - The keys to be omitted from the object.
24 * @returns {Omit<T, K>} A new object with the specified keys omitted.
25 *
26 * @example
27 * omit({ a: 1, b: 2, c: 3 }, 'a', ['b', 'c']);
28 * // => {}
29 */
30declare function omit<T extends object, K extends keyof T>(object: T | null | undefined, ...paths: Array<Many<K>>): Omit<T, K>;
31/**
32 * Creates a new object with specified keys omitted.
33 *
34 * @template T - The type of object.
35 * @param {T | null | undefined} object - The object to omit keys from.
36 * @param {...Array<Many<PropertyKey>>} paths - The keys to be omitted from the object.
37 * @returns {Partial<T>} A new object with the specified keys omitted.
38 *
39 * @example
40 * omit({ a: 1, b: 2, c: 3 }, 'a', 'b');
41 * // => { c: 3 }
42 */
43declare function omit<T extends object>(object: T | null | undefined, ...paths: Array<Many<PropertyKey>>): Partial<T>;
44
45export { omit };
Note: See TracBrowser for help on using the repository browser.