Closed mauriciosoares closed 9 months ago
Btw, if I use R.prop
directly without an array util it does return the correct type:
Thanks for filling this issue. I will look into it.
reason for the change is that I aligned several definitions with @types/ramda
. I will check if we should revert back.
Fix is done, It will be released with Rambda 8.3.0 and Rambdax 10.1.0
Fixed with latest release
I haven't tested this with a lot of different scenarios, but after upgrading rambdax to version 9 I noticed that I got a lot of types errors, after digging a bit I found that these are related to use
R.prop
along with array utils likeR.sortBy
andR.map
, whenever these are used in combination the types returned by these array utils are almost alwaysunknown[]
.Here's an example of using rambdax on version 9.x
https://stackblitz.com/edit/typescript-aiuxp1?file=index.ts
And here's another using version 8.x
https://stackblitz.com/edit/typescript-h8izne?file=index.ts
You'll notice that on version 8, using both R.prop or passing a function as a callback returns the correct type, as opposed to version 9 that only works when using a function as a callback.