pick
Picks the specified keys from an object and returns a new object containing only those key-value pairs.
Import
Usage
Parameters
obj
Record<string, unknown>
The object from which to pick keys
keys
string|string[]
A single key or an array of keys to pick from the object
Returns
Record<string, unknown>
A new object containing only the picked key-value pairs