-
-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] ensure
utils.merge
handles merging two arrays.
- Loading branch information
Showing
2 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
988dbe4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem like this fix affects the consumer of the library in any way. I am testing with strings like
a[0][0][]=1&a[][0][]=2
. Can this be true?988dbe4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The added tests would fail prior to the fix.
It definitely affects
qs.parse
. CompareJSON.stringify(qs.parse('foo[]=bar&foo[][first]=123&foo[second]=456'))
which produces'{"foo":{"0":["bar",{"first":"123"}],"second":"456"}}'
before, and produces'{"foo":{"0":"bar","1":{"first":"123"},"second":"456"}}'
after.