Skip to content

Function: pick() ​

ts
function pick<T, U>(obj: T, paths: readonly U[]): MaybePick<T, U>;

Type Parameters ​

Type Parameter
T extends object
U extends string

Parameters ​

ParameterTypeDescription
objTThe source object
pathsreadonly U[]-

Returns ​

MaybePick<T, U>

A new object with only the specified keys