-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Array support causing unexpected value manipulated #35
Comments
@KVROHITH098 Hi, what did you mean it fixed? I opened the link you provided and the version is 3.x so it did work. |
I think the only way to sensibly handle arrays without breaking objects with numeric-string keys is to handle bracket notation like lodash does. eg |
@patrickfatrick Ditto, It should be more explicit than just turning everything into array with numeric keys. |
I just experienced this issue during development. It was pretty surprising that the set-value call was deleting my data :| At least an option to toggle this would be nice... |
Hi, there
Since our team recently upgraded set-value from v3 to v4, we found there's a severe problem dealing with numeric path.
before v4 paths are treated as properties, so it worked as expected like the following example
but since array index supported in v4, path contains numbers that causes target object's value transformed into an array anyway, and all its properties are gone.
the root cause might be on
set-value/index.js
Lines 148 to 150 in c574eb8
but the quandary is, how to determine a numeric path is tending to set value to an array index or an object property?
I made a codesandbox to reproduce this issue, versions switch is available on the left panel, please let me know if any further information is needed
The text was updated successfully, but these errors were encountered: