MCPcopy Create free account
hub / github.com/bernaferrari/FigmaToCode / curry

Function curry

packages/backend/src/common/curry.ts:1–13  ·  view source on GitHub ↗
(
  fn: T,
  arity = fn.length,
)

Source from the content-addressed store, hash-verified

1export function curry<T extends (...args: any[]) => any>(
2 fn: T,
3 arity = fn.length,
4): any {
5 return function curried(...args: any[]): any {
6 if (args.length >= arity) {
7 return fn(...args);
8 }
9 return function (...moreArgs: any[]) {
10 return curried(...args, ...moreArgs);
11 };
12 };
13}

Callers 2

altNodeUtils.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected