-
-
Notifications
You must be signed in to change notification settings - Fork 736
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 Type Comma is producing the output of Array Format Repeat when the array length is 1 #442
Comments
I encountered the same problem. I locked version 6.9.6 |
Thanks for your reply. Unfortunately this module is being used by some other module. And I'm using that module for my usecase. |
This isn’t a bug, it is intentional behavior so that stringifying will preserve the array-ness. |
See #434 |
I have read the thread. But Shouldn't it be configurable? Can we have another option along with
Because there can be usecases like One can use In our case, We stringify it and pass the query string to an external service and that service doesn't use the Any thoughts @ljharb |
we run into the same issue with the new version. not all APIs we are using are capable to handling query strings with brackets, they are expecting comma separated lists in all cases or no comma if it is only one value. +1 for the additional option to toggle the "Arrayness" feature. |
we have also just slammed into this issue. Tis causing a great deal of errors in production for us right now (we use QS to stringify params which are sent to an API - which does NOT support array bracket query string notation). 😭 for now, we'll just lock to |
Same here - I'd appreciate a configurable option. |
I will plan on reverting the behavior by default, and adding an option to satisfy the original request. |
I have overcome this issue temporarily by converting my arrays to length 2
when the actual length is 1
Example original array - [‘abc’]
Transformed array- [‘abc’,’’]. Just added an empty element at the end. This
solved my problem for now.
But it would be great if we can revert the recent change since many of the
production applications are breaking.
On Wed, 15 Jun 2022 at 9:56 PM, Benjamin Shoemaker ***@***.***> wrote:
Same here - I'd appreciate a configurable option.
—
Reply to this email directly, view it on GitHub
<#442 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AREQDQUMEP6P4YKEY22VUHTVPH747ANCNFSM5YIVZJXA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Manoj Kumar
Richpanel.com
|
This comment was marked as spam.
This comment was marked as spam.
Released in v6.11.0. |
qs.stringify({ a: ['b'] }, { arrayFormat: 'comma' })
should return thea=b
.But it is returning the
repeat
type format -a%5B%5D=b ~ a[]=b
Below is the documentation and expected behaviour from readme
Below is the screenshot for the same
Can anyone help me if this is an issue or Am I missing something?
The text was updated successfully, but these errors were encountered: