pick

Variable

从对象中挑选指定的若干个 key,返回只包含这些 key 的新对象

Signature

const pick: <T extends object, TKeys extends keyof T>(obj: T, keys: TKeys[]) => Pick<T, TKeys>

Examples

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

Source

node_modules/.pnpm/radash@12.1.1/node_modules/radash/dist/index.d.ts:498