1.0.1 • Published 2 years ago

uinix-fp-k v1.0.1

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

uinix-fp-k

Build Coverage Downloads Size

uinix-fp constant/always utility.


Install

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

npm install uinix-fp-k

Use

k is a curried function always returning the first provided value.

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

k(42)(9000); // 42

const alwaysTrue = k(true);

alwaysTrue(false); // true
[1, 2, 3].map(alwaysTrue); // [true, true, true];

API

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

k(x)(y)

Parameters (Curried)
  • x (X) — Provided value
  • y (Y) — Second provided value (unused)
Returns
  • X — Always returns x

License

MIT © Chris Zhou