@hanshi/prelude
v0.2.4
Published
A package providing a cluster of basic functions for hanshi.
Downloads
192
Maintainers
Readme
prelude
import { _, curry } from '@hanshi/prelude';
const add = (a: number, b: number) => a + b;
const add2With = _(add, 2);
console.log(add(2, 3) === add2With(3));
const linear = (a: number, b: number, x: number) => a * x + b;
const curriedLinear = curry(linear);
const [a, b, c] = [...Array(3).keys()].map(() => Math.random());
console.log(linear(a, b, c) === curriedLinear(a)(b)(c));