-
Notifications
You must be signed in to change notification settings - Fork 196
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
Does unflatten enter into infinite recursion on function or array members? #94
Comments
I think perhaps the problem might be the recursion into the |
I think I have a solution. For my use-case, I simply need Lines 144 to 145 in 6e95c43
Edit: As well as only ever enter the first case here (i.e., not call Lines 100 to 109 in 6e95c43
Would it be possible to add an option that controls this? |
I decided to implement my own |
I'm using this library in an F# project (transpiles to JS through using Fable). So unfortunately I have no JS repro (I'm not a JS dev).
unflatten
is mostly working fine, but it seems to enter into infinite recursion on some objects. This happens even when there is seemingly nothing to unflatten.I have an array of key-value pairs (React props) that I'm converting into an object, and then I'm using
unflatten
on this object.This works fine for some prop arrays, such as this:
However, for others, such as this, it enters into an infinite recursion:
As you can see, in both cases, the original prop list (and thus the object) does not contain keys with the delimiter, and there are no sub-objects to recurse into (unless it does something with the function), so AFAIK
unflatten
shouldn't modify anything.I have tried
safe
without any effect.The weird thing is, the stack trace seems to come from the
flatten
function, which I do not call:The text was updated successfully, but these errors were encountered: