js-url
js-url copied to clipboard
Issues parsing arguments that are arrays with non-numeric keys
There seems to be an issue parsing non-numeric keys in array arguments. Check out the following,
> JSON.stringify(url('?','?t[0]=x&t[1]=y'));
"{"t":["x","y"]}"
> JSON.stringify(url('?','?t[a]=x&t[b]=y'));
"{"t[a]":"x","t[b]":"y"}"
The expected behavior is,
> JSON.stringify(url('?','?t[0]=x&t[1]=y'));
"{"t":["x","y"]}"
> JSON.stringify(url('?','?t[a]=x&t[b]=y'));
"{"t":{"a":"x","b":"y"}}"