uinix-fp-map
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i uinix-fp-map

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

2.77 kB

Total Files

4

Last publish

Collaborators

  • chrisrzhou