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
Thank you between for such a great Curry generic, I had read your post on medium(published about 2 years ago), and it is one of the most interesting, complex and beutiful typescript generics I had ever seen. Though I did not understand it fully yet.
I am trying to use Curry generic to type ramda's propOr function.
typepropOrType=<D,Oextendsobject,Pextendsstring>(defaultValue: D,propName: P,obj: O,)=>D|(PextendskeyofO ? O[P] : never);declareconstpropOr: _.F.Curry<propOrType>;constalice={name: 'ALICE',age: 101,};letage=propOr('Default value','age',alice);// => '101'// type of age is `unknown` but must be at least `string | number`
I expect type of 'age' to be 101 | 'Default value' or at least number | string but I am getting unknown type.
The text was updated successfully, but these errors were encountered:
🐞 Bug Report
Thank you between for such a great
Curry
generic, I had read your post on medium(published about 2 years ago), and it is one of the most interesting, complex and beutiful typescript generics I had ever seen. Though I did not understand it fully yet.I am trying to use
Curry
generic to type ramda'spropOr
function.I expect type of 'age' to be
101 | 'Default value'
or at leastnumber | string
but I am gettingunknown
type.The text was updated successfully, but these errors were encountered: