2.10.0 • Published 4 years ago
@unction/onlykeys v2.10.0
@unction/onlyKeys
Array | Set => Array | Set | Record<string | number | symbol, B> | Map<B, A> | string => Array | Set | Record<string | number | symbol, B> | Map<B, A> | string
Reduces the keyed enumerable to an object with only the keys provided.
onlyKeys(
["alpha", "beta", "delta"]
)(
{
feta: "0",
alpha: "1",
beta: "2",
delta: "3",
}
)
// {
// alpha: "1",
// beta: "2",
// delta: "3",
// }