-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
Add arrayFormat option #70
Conversation
Also, don't use indices in array query string values. Fixes #721
This would be a breaking change, but I think we can tweak it to not be breaking fairly easily.. Change the default if Allow passing |
Note that with those tweaks, I'd feel better if you left the old existing tests in place and only added new ones so we can be certain we're not breaking anything. |
@nlf I thought this change might be worth breaking backwards compat instead of having two separate options for specifying the same thing. e.g. if you use both the old IMHO it would be cleaner to just say "if you're using >=2.4 use arrayFormat". But if you'd still like to preserve compat with the |
b84d9ad
to
0311603
Compare
@nlf I updated the PR so the default is |
I'd definitely prefer to not make this a breaking change just yet. I think we document the I have a few other things I intend to work on for the next major version bump, so when that stuff is complete is when we'll remove the |
This commit adds the arrayFormat option to qs.stringify. Valid values are "indices" (the default), "repeat", or "brackets". Backwards compat is preserved with the indices option as well.
0311603
to
9c46a95
Compare
@nlf Gotcha. I've updated the PR to support the |
BTW, it looks like this may supersede #65 |
Perfect! This looks great, thanks! |
Awesome. Thanks for being so responsive @nlf ! :) |
Hi, can we get this version published on npm in the near future? We have similar feature request here request/request#1473 |
Just published 2.4.0, I had it all primed and everything and just never hit enter. Sorry about that! |
Thanks 👍 |
The
arrayFormat
option recognizes 3 values: brackets, indices, andrepeat. It defaults to
bracketindices.See the comments in #46