Documentation
Functions
pick

Function: pick()

pick<T, K>(obj, ...keys): Pick<T, K>

From obj, create a new object that only includes keys.

Type parameters

Parameter
T extends Record<any, unknown>
K extends string | number | symbol

Parameters

ParameterType
objT
...keysK[]

Returns

Pick<T, K>

Example

pick({ a: 1, b: 2, c: 3 }, 'a', 'c') // { a: 1, c: 3 }

Source

src/utils/helpers.ts:33 (opens in a new tab)