omit
omit<
T>(params):Record<string,unknown>
Defined in: objects/omit/index.ts:55
Creates an object with the specified keys removed.
Type Parameters
Section titled “Type Parameters”T extends Record<string, unknown>
Parameters
Section titled “Parameters”params
Section titled “params”OmitParams<T>
The parameters object
Returns
Section titled “Returns”Record<string, unknown>
A new object without the specified keys
Example
Section titled “Example”omit({ obj: { a: 1, b: 2, c: 3 }, keys: ["b", "c"] });// => { a: 1 }Keywords
Section titled “Keywords”exclude keys, remove properties, without keys, strip fields
Throws
Section titled “Throws”Error if obj is not an object
Throws
Section titled “Throws”Error if keys is not an array