GuobaGuoba Utils

omit

@guoba-ai/utils / object / omit

Function: omit()

function omit<T, K>(obj, keys): Omit<T, K>;

Defined in: object.ts:60

Create a new object with specified keys omitted.

Type Parameters

T

T extends object

K

K extends string | number | symbol

Parameters

obj

T

The source object

keys

K[]

Keys to omit

Returns

Omit<T, K>

A new object without the specified keys

Example

omit({ a: 1, b: 2, c: 3 }, ['b', 'c']) // { a: 1 }

On this page