uinix-fp-k

uinix fp constant/always utility

Usage no npm install needed!

<script type="module">
  import uinixFpK from 'https://cdn.skypack.dev/uinix-fp-k';
</script>

README

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