Skip to content

Bad parse when turning array into object #74

@dougwilson

Description

@dougwilson

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions