fix typo in curry type

This commit is contained in:
Rowan 2025-03-31 07:30:46 -05:00
parent 27e00bbc11
commit 1884f59229
2 changed files with 14 additions and 4 deletions

View file

@ -20,7 +20,7 @@
/**
* @template {any[]} T
* @typedef {{ 0: Last<Tail<T>>, 1: Head<T> }[HasTail<T> extends true ? 0 : 1]} Last
* @typedef {{ 0: Last<Tail<T>>; 1: Head<T> }[HasTail<T> extends true ? 0 : 1]} Last
*/
/**
@ -38,8 +38,7 @@
* @template {number} N
* @template {any[]} T
* @template {any[]} [I = []]
* @typedef {{ 0: Drop<N, Tail<T>, Prepend<any, T>>; 1: T }[Length<I> extends N ? 1 : 0]} Drop
* @typedef {Drop<2, [0, 1, 2, 3, 4]>} t00
* @typedef {{ 0: Drop<N, Tail<T>, Prepend<any, I>>; 1: T }[Length<I> extends N ? 1 : 0]} Drop
*/
/**
@ -69,3 +68,15 @@ export function curry(func) {
}
}
const a = curry(
/**
* @param {number} a
* @param {number} b
* @param {number} c
*/
(a, b, c) => a + b + c
)
const b = a(1)
const c = b(1)

View file

@ -1,3 +1,2 @@
export * from './algebra/index.js'
export * from './curry.js'