-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$raw support numbered indexes for ramda #10
Comments
I believe a simple fix to this line would do: Line 61 in 271f283
Changing it to something like: return typedPath(handlersConfig, [...path, (typeof name === 'number' ? name : name.toString())], true); This would break some typing currently in place but would also make sure we support ramda properly. |
Hi @paul-sachs I've added another default handler, |
@bsalex Yeah I'll give it a shot in the next few days. Thanks for the quick response. |
@bsalex looks better. I think my version of ramda has problems with the |
@paul-sachs Could you clarify whether the changes in the Also, it would be great to add documentation for a simple use case with |
@bsalex yeah, i'll write something up shortly. My example is pretty nested in an application so I'll simplify and put something together. |
@bsalex I've created a simple codesandbox to show the issue: https://codesandbox.io/s/thirsty-sunset-q85b2?file=/src/App.tsx You can see the change in array status if you switch to an older version of typed-path (and replace $rawPath with $raw) |
Thanks for the contribution, |
I'm closing the issue, thanks again for the report. |
Currently, using an index field with ramda can cause some confusion:
This produces a path of ['array', index.toString(), 'x', 'y']. This causes problems in ramda since it looks to the path type to determine array or object. This will cause something like
assocPath
to turn an array into an object.The text was updated successfully, but these errors were encountered: