@unction/pluck
v10.14.0
Published
Given a keychain and records return the values at the keychain for each record
Downloads
98
Readme
@unction/pluck
KeyChainType => Array | Set | Record<string | number | symbol, B> | Map<B, A> | string => Array
Given a keychain and records return the values at the keychain for each record.
pluck(
["attributes", "name"]
)(
[
{
id: "1",
attributes: {
name: "Kurtis",
age: 29,
height: "5'10\"",
},
},
{
id: "2",
attributes: {
name: "Chris",
age: 29,
height: "5'8\"",
},
},
]
)
Which will return:
[
"Kurtis",
"Chris"
]