You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeCurryV5<Pextendsany[],R>=<Textendsany[]>(...args: Cast<T,Partial<P>>)=>Drop<Length<T>,P>extends[any, ...any[]]
? CurryV5<Drop<Length<T>,P>extendsinferDT ? Cast<DT,any[]> : never,R>
: R// When all the non-rest parameters are consumed, `Drop<Length<T>, P>` can only// match `[...any[]]`. Thanks to this, we used `[any, ...any[]]` as a condition// to end the recursion.// Let's test it:declarefunctioncurryV5<Pextendsany[],R>(f: (...args: P)=>R): CurryV5<P,R>consttoCurry09=(name: string,age: number, ...nicknames: string[])=>trueconstcurried09=curryV5(toCurry09)consttest47=curried09('Jane',26)('JJ','Jini')// booleanconsttest48=curried09('Jane')(26,'JJ','Jini')// booleanconsttest49=curried09('Jane')(26)('JJ',900000)// error
The text was updated successfully, but these errors were encountered:
typescript version: 4.3.5
hi, it seems there is wrong with CurryV5 if using as follow:
here is complete examples:
The text was updated successfully, but these errors were encountered: