core3-utils

@wixc3/common on Github

Home > @wixc3/common > pick

pick() function

returns an object composed of the picked object properties

Signature:

export declare function pick<O extends object, K extends keyof O>(record: O, keys: Iterable<K>): Pick<O, K>;

Parameters

Parameter Type Description
record O
keys Iterable<K>

Returns:

Pick<O, K>

Example

pick({ a: 1, b: 2 }, ['a']) // => { a: 1 }