uinix-fp-k
v1.0.1
Published
uinix fp constant/always utility
Downloads
6
Readme
uinix-fp-k
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 valuey
(Y
) — Second provided value (unused)
Returns
X
— Always returnsx