tj / node-querystring

querystring parser for node and the browser - supporting nesting (used by Express, Connect, etc)
MIT License
455 stars 66 forks source link

updated so that objects are default unless [] are empty and updated test... #98

Open silkcom opened 10 years ago

silkcom commented 10 years ago

updated so that objects are default unless [] are empty and updated tests to verify it works

Basically the point of this is to make it work more like PHP and Rails.

Items[1]=on&items[4]=on

will now become: { items: { 1: on, 4: on } }

rather than { items: [on, on] }

Updated tests to make sure that it didn't mess up even when [] and [99999] was used.

items[]=on&items[]=on will still equal { items: [on, on] }

silkcom commented 10 years ago

anything blocking this from being merged? I'd really like to remove the hacks that I have to add to my html

buschtoens commented 10 years ago

Will check this in about 4 hours. I'm on the move right now.

silkcom commented 10 years ago

Has this been merged in? It still passes build tests right?

moll commented 10 years ago

Just stumbled upon this problem too that number-like keys are lost when between brackets. So, any news on this?