Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Close #137
While debugging, it turned out that what current implementation does is taking value by key (create if not exists) and append array values to it.
So, actually, the following:
was ending up with
a = [2, 3, 5]
. So, arrays with same paths were always concatenating, as if one was continuation of another.And as far as I understand the specs, the only case when arrays are concatenated is when they are separated with non-newline while space. From README:
So for me, this is a special case that should be explicitly handled. Like when you have
]
token, check if next tokens are some white-spaces and then[
token - and in that case just skip this part and keep going.So, that is what basically my fix is doing:
a
) and there is already existing array, do not concatenate them (I am callingClear
on old value)