sodiray / radash

Functional utility library - modern, simple, typed, powerful
https://radash-docs.vercel.app
MIT License
4.1k stars 160 forks source link

Return type for `partial` is `any` #372

Open danmichaelo opened 8 months ago

danmichaelo commented 8 months ago

partial returns any, which doesn't seem to be in line with the project's focus on strong typing.

its-hmny commented 4 months ago

Hi @danmichaelo, seems to be fixed in version 12.1.10, the following code:

const add = (a: null, b: number): number => a + b
partial(add, null)(5);

produces the given type annotation and works at the typechecking level

const` partial: <[a: null, b: number], [null], number>(fn: (a: null, b: number) => number, args_0: null) => (b: number) => number