js-url icon indicating copy to clipboard operation
js-url copied to clipboard

Issues parsing multidimensional array arguments

Open maxguru opened this issue 6 years ago • 0 comments

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"]]}"

maxguru avatar Mar 06 '18 07:03 maxguru