@unction/reducewithvaluekey
v11.13.0
Published
Reduces over a functor, providing the reducer with the value and key
Downloads
455
Readme
@unction/reduceWithValueKey
ReducerFunctionType<A, B | D, C> => D => Array | Set | Record<string | number | symbol, B> | Map<B, A> | string => E
Reduces over a functor, providing the reducer with the value and key.
reduceWithValueKey(
(accumulation) => (current) => (key) => `${accumulation}/${current}:${key}`
)(
"~"
)(
["Users", "krainboltgreene", "Code"]
)
Which will return:
"~/Users:0/krainboltgreene:1/Code:2"