websanova / js-url

url() - A simple, lightweight url parser for JavaScript
http://www.websanova.com
MIT License
1.93k stars 204 forks source link

Issues parsing multidimensional array arguments #67

Open maxguru opened 6 years ago

maxguru commented 6 years ago

Multidimensional arrays are not parsed correctly,

> JSON.stringify(url('?','?t[0][0]=x'));
"{"t[0]":["x"]}"
> JSON.stringify(url('?','?t[0][0]=x&t[1][0]=y'));
"{"t[0]":["x"],"t[1]":["y"]}"

The expected behavior is as follows,

> JSON.stringify(url('?','?t[0][0]=x'));
"{"t":[["x"]]}"
> JSON.stringify(url('?','?t[0][0]=x&t[1][0]=y'));
"{"t":[["x"],["y"]]}"