fix typo in curry type
This commit is contained in:
parent
27e00bbc11
commit
1884f59229
2 changed files with 14 additions and 4 deletions
17
src/curry.js
17
src/curry.js
|
@ -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)
|
||||
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
export * from './algebra/index.js'
|
||||
export * from './curry.js'
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue