-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: nested repeated array syntax (#43)
Fixes #42 Essentially we had two bugs 👀 Bug 1: if you have repeat syntax when using bracket-notation, but only had one key, we would _not_ create it as a string. For example: ```ts parse('foo[]=1', opts); // {foo: 1} - wrong! parse('foo[]=1&foo[]=2', opts); // {foo: [1, 2]} - right! ``` Bug 2: if you have repeat syntax following an index-nested member, we would not parse it correctly. For example: ```ts parse('foo[bar][]=1', opts); // {foo: {bar: 1}} - wrong! // expected: {foo: {bar: [1]}} ``` These should both now be fixed.
- Loading branch information
Showing
2 changed files
with
144 additions
and
24 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