Creates a curried version of a function that supports rest parameters.
Works for both fixed-arity and variadic (rest) functions.
const add = curry((a: number, b: number, c: number) => a + b + c);add(1)(2)(3); // 6add(1, 2)(3); // 6add(1)(2, 3); // 6const join = curry((a: string, b: string, ...rest: string[]) => [a, b, ...rest].join("-"));join("a")("b")("c", "d"); // "a-b-c-d" Copy
const add = curry((a: number, b: number, c: number) => a + b + c);add(1)(2)(3); // 6add(1, 2)(3); // 6add(1)(2, 3); // 6const join = curry((a: string, b: string, ...rest: string[]) => [a, b, ...rest].join("-"));join("a")("b")("c", "d"); // "a-b-c-d"
1.2.0
Creates a curried version of a function that supports rest parameters.
Works for both fixed-arity and variadic (rest) functions.