/curry

curry

Primary LanguageTypeScriptISC LicenseISC

@spudly/curry

Creates a curried function

GitHub Workflow Status Codecov version downloads NPM

All Contributors PRs Welcome Code of Conduct

Watch on GitHub Star on GitHub Tweet

Installation

npm install --save @spudly/curry

Usage

import curry from '@spudly/curry';

const add = curry((a, b, c) => a + b + c);
curriedAdd(1, 2, 3); // => 6
curriedAdd(1, 2)(3); // => 6
curriedAdd(1)(2, 3); // => 6
curriedAdd(1)(2)(3); // => 6

Contributors

This project follows the all-contributors specification. Contributions of any kind welcome!