Skip to content

pluck

pluck<T, K>(obj, keys): Pick<T, K>

Defined in: utils/object.ts:9

Plucks the specified keys from an object and returns a new object with only those keys.

Type Parameters

T extends object

The type of the original object.

K extends string | number | symbol

The keys to pluck from the original object.

Parameters

obj

T

The original object.

keys

K[]

The keys to pluck from the original object.

Returns

Pick<T, K>

A new object with only the plucked keys.