1.0.0 • Published 2 years ago

uinix-fp-map v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

uinix-fp-map

Build Coverage Downloads Size

uinix-fp array map utility.


Install

This package is ESM-only and requires Node 12+.

npm install uinix-fp-map

Use

import {map} from 'uinix-fp-map';

const square = x => x ** 2;

map(square)([1, 2, 3]); // [1, 4, 9]

const mapSquare = map(square); // curried
mapSquare([1, 2, 3]); // [1, 4, 9]

API

This package exports the following identifiers: map. There is no default export.

map(f)(xs)

Parameters (Curried)
  • f ((x: X) => Y): The mapping function
  • x (X): Any value
Returns
  • Y[] — Array of values returned by the mapping function

License

MIT © Chris Zhou