Proper type safe way of currying functions in typescript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore
.npmignore
.prettierrc
.travis.yml
README.md
index.ts
package.json
tsconfig.json
yarn.lock

README.md

ts-curry Build Status

Currying utility for typescript.

Usage

The module supports functions of upto the arity of 4 via — curry2 curry3 curry4. For functions having a higher arity its better to refactor the function into smaller functions of lower arity.

import {curry2} from 'ts-curry'

const func = (a: number, b: Date) => a + b.getDay()
const curried = curry2(func)
curried(2, new Date())
curried(2)(new Date())