Skip to main content

pick()

Param

Source object.

Param

Unconstrained iterable of keys to pick, such as in array or Map.

pick(input, scalarEnum, transform)

function pick<O, K>(
input,
scalarEnum,
transform?): Pick<O, StringKeyOf<O>>

Type Parameters

Type Parameter
O extends object
K extends string

Parameters

ParameterTypeDescription
inputOSource object.
scalarEnumRecord<K, K>Unconstrained scalar enum whose values present in input will be used as keys, such as an enum-like object.
transform?(value, key, input) => any-

Returns

Pick<O, StringKeyOf<O>>

A subset of the source object with only properties present in constraints.

A subset of the source object with only properties present in scalarEnum.

Param

Source object.

Param

Unconstrained iterable of keys to pick, such as in array or Map.

pick(input, setLike, transform)

function pick<O, K>(
input,
setLike,
transform?): Pick<O, K>

Type Parameters

Type Parameter
O extends object
K extends string | number | symbol

Parameters

ParameterTypeDescription
inputOSource object.
setLikeSetLike<K>Set-like object whose members represent the subset of keys to pick.
transform?(value, key, input) => any-

Returns

Pick<O, K>

A subset of the source object with only properties present in constraints.

A subset of the source object with only properties present in scalarEnum.

Param

Source object.

Param

Unconstrained iterable of keys to pick, such as in array or Map.

pick(input, scalarEnum, transform)

function pick<O, K>(
input,
scalarEnum,
transform?): Pick<O, StringKeyOf<O>>

Type Parameters

Type Parameter
O extends object
K extends string | number | symbol

Parameters

ParameterTypeDescription
inputOSource object.
scalarEnumRecord<K, K>Enum-like object whose members represent the subset of keys to pick.
transform?(value, key, input) => any-

Returns

Pick<O, StringKeyOf<O>>

A subset of the source object with only properties present in constraints.

A subset of the source object with only properties present in scalarEnum.

Param

Source object.

Param

Unconstrained iterable of keys to pick, such as in array or Map.

pick(input, constraints, transform)

function pick<O, K>(
input,
constraints,
transform?): Pick<O, K>

Type Parameters

Type ParameterDefault type
O extends object-
K extends string | number | symbolExtract<keyof O, string>

Parameters

ParameterTypeDescription
inputOSource object.
constraintsIterable<K, any, any>Unconstrained iterable of keys to pick, such as in array or Map.
transform?(value, key, input) => any-

Returns

Pick<O, K>

A subset of the source object with only properties present in constraints.

A subset of the source object with only properties present in constraints.

Param

Source object.

Param

Unconstrained iterable of keys to pick, such as in array or Map.

pick(input, constraints, transform)

function pick<O, K>(
input,
constraints,
transform?): Pick<O, K>

Type Parameters

Type ParameterDefault type
O extends object-
K extends string | number | symbolExtract<keyof O, string>

Parameters

ParameterTypeDescription
inputOSource object.
constraintsRecord<K, K>Enum-like object whose members represent the subset of keys to pick.
transform?(value, key, input) => any-

Returns

Pick<O, K>

A subset of the source object with only properties present in constraints.

A subset of the source object with only properties present in constraints.

Param

Source object.

Param

Unconstrained iterable of keys to pick, such as in array or Map.

pick(input, keys, transform)

function pick<O, K>(
input,
keys,
transform?): Pick<O, StringKeyOf<O>>

Type Parameters

Type Parameter
O extends object
K extends string

Parameters

ParameterTypeDescription
inputOSource object.
keysIterable<K, any, any>Unconstrained iterable of keys to pick, such as in array or Map.
transform?(value, key, input) => any-

Returns

Pick<O, StringKeyOf<O>>

A subset of the source object with only properties present in constraints.

A subset of the source object with only properties present in keys.

Param

Source object.

Param

Unconstrained iterable of keys to pick, such as in array or Map.