-
Notifications
You must be signed in to change notification settings - Fork 14
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
Cant merge an json Array #11
Comments
Unfortunately this is currently expected behavior when the array contains objects. The actual object merging is handled by deepmerge, which concats simple array values but merges objects. There are a couple of open PRs (e.g. TehShrike/deepmerge#21) that seem like they'll solve this issue, but there hasn't been much movement lately. Once they're merged or an alternative is found, I'd be happy to accept a PR to expose a setting for this behavior. |
my solution |
I didn't think of using lodash's merge. Version 0.4.0 that was just published to npm has a "concatArrays" option that should do what you're looking for now. I will update the documentation soon, but if you were to replace |
{"modules": [{"id": 2}]}
{"modules": [{"id": 1}, {"id": 2}]}
file1.json
{"modules": [{"id": 1}]}
file2.json
{"modules": [{"id": 2}]}
The text was updated successfully, but these errors were encountered: