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

10.14.0 • Public • Published

@unction/sequence

Tests Stability Dependencies

Array<MapperFunctionType<A, B>> | Set<MapperFunctionType<A, B>> | Record<string | number | symbol, MapperFunctionType<A, B>> | Map<unknown, MapperFunctionType<A, B>> => A => Array | Set | Record<string | number | symbol, unknown> | Map<B, unknown> | string Array<MapperFunctionType<A, B>> => A => Array Set<MapperFunctionType<A, B>> => A => Set ObjectType<unknown, MapperFunctionType<A, B>> => A => ObjectType<unknown, B> Map<unknown, MapperFunctionType<A, B>> => A => Map<unknown, B>

Takes a list of functions, a value, and applies that value to each function, returning an array of results.

sequence([increment, decrement])(1) // [2, 0]
sequence(new Set([increment, decrement]))(1) // {2 0}
sequence(new Map([["a", increment], ["b", decrement]]))(1) // {{"a" 2}, {"b" 0}}
sequence({x: increment, y: decrement, z: itself})(1) // {x: 2, y: 0, z: 1}

Readme

Keywords

Package Sidebar

Install

npm i @unction/sequence

Weekly Downloads

0

Version

10.14.0

License

SEE LICENSE IN LICENSE

Unpacked Size

17.2 kB

Total Files

7

Last publish

Collaborators

  • krainboltgreene