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

Bad parse when turning array into object #74

Closed
dougwilson opened this issue Mar 15, 2015 · 2 comments
Closed

Bad parse when turning array into object #74

dougwilson opened this issue Mar 15, 2015 · 2 comments
Assignees
Milestone

Comments

@dougwilson
Copy link
Contributor

The following shows that when a key starts as an array, values that match Object.prototype keys are basically treated as if they are just an empty bracket for some reason. I would not expect the 1 property to exist in the example below:

$ node -pe 'require("qs").parse("a[]=b&a[hasOwnProperty]=c&a[x]=y")'
{ a: { '0': 'b', '1': 'c', x: 'y' } }

$ node -pe 'require("qs/package").version'
2.4.1
@dougwilson
Copy link
Contributor Author

And the following parse is even more bizarre:

$ node -pe 'require("qs").parse("a[]=b&a[t]=u&a[hasOwnProperty]=c")'
{ a: { '0': 'b', t: 'u', c: true } }

@nlf nlf added the bug label Mar 18, 2015
@nlf nlf self-assigned this Mar 18, 2015
@nlf
Copy link
Collaborator

nlf commented May 21, 2015

this is related to #80

@nlf nlf added this to the 3.0.0 milestone May 21, 2015
@nlf nlf closed this as completed in 211ba0f May 22, 2015
@ljharb ljharb added the parse label Jun 15, 2017
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

3 participants