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
arrayformat as comma with empty array or objects #310
Comments
Are you suggesting that |
Yes, i'm suggesting that comma shouldn't include foo :) All three other does not include it and i expected comma don't too. What do you think ? |
That seems reasonable to me. |
Did you started or planing to workin on ? Cause if you need, when i got time, i will make you a pull request |
@davidlandais nope, help wanted means it's up for grabs :-) a PR would be great. |
I would like to offer my 2c on the opposite; I believe we should not strip the key out of the original object. |
It's a bug, I'll fix that later |
SuggestionThere’s a use case where you have to convey the presence of an array, empty or not, and I find |
@issuefiler what is one use case for that? |
# Conflicts: # dist/qs.js
An index REST api endpoint that takes filters that are query params in an 'in' style: An empty array would filter to no elements but no query params (ie status=[] where qs would stringify as empty) would get all. |
stringify
will produce?foo=&bar=&baz=abc
. But usingbrackets
,indices
,repeat
as array format will not concatfoo
cause it's an empty array.comma
is the only one which keep foo. Is it a bug or a conception choice ?In
lib/stringify.js
, line 67, maybe you could test if it's an array with values ?The text was updated successfully, but these errors were encountered: