@unction/hammer
A => Array | Set | Record<string | number | symbol, B> | Map<B, A> | string => Array | Set | Record<string | number | symbol, B> | Map<B, A> | string
Use this to de-nest a nested keyed enumerable.
const payload = {
id: 1
attributes: {
name: "Kurtis Rainbolt-Greene",
age: 26
}
}
hammer("attributes")(payload)
Which returns:
{
id: 1,
name: "Kurtis Rainbolt-Greene",
age: 26
}