Skip to content
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

The arrayFormat parameter ignored with a single-element array #444

Closed
T-PWK opened this issue Jun 15, 2022 · 1 comment
Closed

The arrayFormat parameter ignored with a single-element array #444

T-PWK opened this issue Jun 15, 2022 · 1 comment

Comments

@T-PWK
Copy link

T-PWK commented Jun 15, 2022

The arrayFormat parameter seems to be ignored when using a single-element array.
Example:

qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' })

will return a=b,c (a=b%2Cc), however, when there is a single array element like in the following example:

qs.stringify({ a: ['b'] }, { arrayFormat: 'comma' })

the library returns a[]=b (a%5B%5D=b)

This issue started appearing in the latest version 6.10.5. Version 6.10.3 works as expected.

@ljharb
Copy link
Owner

ljharb commented Jun 15, 2022

It’s not a bug; it’s intentional. However, it will be put behind an option; duplicate of #442.

@ljharb ljharb closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants