@hanshi/prelude
TypeScript icon, indicating that this package has built-in type declarations

0.2.4 • Public • Published

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));

Package Sidebar

Install

npm i @hanshi/prelude

Weekly Downloads

3

Version

0.2.4

License

MIT

Unpacked Size

29.9 kB

Total Files

7

Last publish

Collaborators

  • yguo125