ts-curry is a specialized utility library designed for currying functions in TypeScript, providing type-safe currying transformations for functions with up to four arguments. The package's current stable version is 1.0.4, released in July 2018. It has seen no further updates or releases since then, indicating that the project is abandoned. While it offers type safety for currying, its limitation to functions of arity 4 or less, and the lack of maintenance for several years, means it may not be compatible with modern TypeScript versions (e.g., TS 4.x, 5.x) or offer the flexibility of more actively maintained functional programming libraries. Its primary differentiator was its strong TypeScript typing at the time of its release.
npm install ts-curryVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing `curry2` and applying it to a TypeScript function, showing both single-call and step-by-step curried invocation, along with basic type safety.
Consider migrating to actively maintained functional programming libraries like Lodash/fp, Ramda, or a more modern TypeScript-focused utility that offers up-to-date type definitions and broader currying support.
For functions with higher arity, the library recommends refactoring them into smaller functions of lower arity. Alternatively, use a different currying library that supports arbitrary arity or provides a more generic `curry` function.
Ensure your `tsconfig.json` and build tool configurations (e.g., Webpack, Rollup, Vite) are set up to correctly handle older CommonJS modules. If issues persist, consider using a more contemporary library that offers native ESM support.
Ensure you are using `import { curry2 } from 'ts-curry';` in a TypeScript/ESM context. If you must use CommonJS `require`, ensure your bundler or TypeScript configuration (e.g., `"module": "commonjs", "esModuleInterop": true`) is correctly set up to handle interop with older libraries.The `ts-curry` library is limited to currying functions of up to 4 arguments. Refactor your function to have 4 or fewer arguments, or choose a different currying library that supports higher arity functions.
Ensure that the arguments passed to the curried function strictly conform to the expected TypeScript interface defined within `ts-curry`'s types. You might need to cast values or create specific instances that satisfy the type requirements, as shown in the quickstart example (e.g., `new Date() as MyDate`).
No dependency data recorded yet.