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

Duplicates set to last, should not apply to arrays without index #514

Open
ronnyhaase opened this issue Oct 23, 2024 · 1 comment
Open

Comments

@ronnyhaase
Copy link

Hi!

Maybe I'm mistaken, but I think when duplicates is set to "last", it should not apply to arrays without indices:

qs.parse("a=1&a=2&b[]=1&b[]=2", {duplicates: "last"})
results in
{ a: '2', b: [ '2' ] }

Where a is correct, but b was not what I expected.

@ljharb
Copy link
Owner

ljharb commented Oct 23, 2024

I agree, this is a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants