@unction/reducewithvaluekey
TypeScript icon, indicating that this package has built-in type declarations

11.13.0 • Public • Published

@unction/reduceWithValueKey

Tests Stability Dependencies

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"

Readme

Keywords

Package Sidebar

Install

npm i @unction/reducewithvaluekey

Weekly Downloads

40

Version

11.13.0

License

SEE LICENSE IN LICENSE

Unpacked Size

32.3 kB

Total Files

7

Last publish

Collaborators

  • krainboltgreene