Comparing version 0.0.7 to 0.1.0
@@ -34,1 +34,7 @@ | ||
require('inspect')(obj) | ||
var obj = qs.parse('user[names]=tj&user[names]=TJ&user[names]=Tyler'); | ||
require('inspect')(obj) | ||
var obj = qs.parse('user[name][first]=tj&user[name][first]=TJ'); | ||
require('inspect')(obj) |
0.1.0 / 2011-04-13 | ||
================== | ||
* Added jQuery-ish array support | ||
0.0.7 / 2011-03-13 | ||
@@ -6,2 +11,3 @@ ================== | ||
* Fixed; handle empty string and `== null` in `qs.parse()` [dmit] | ||
allows for convenient `qs.parse(url.parse(str).query)` | ||
@@ -8,0 +14,0 @@ 0.0.6 / 2011-02-14 |
@@ -12,3 +12,3 @@ | ||
exports.version = '0.0.7'; | ||
exports.version = '0.1.0'; | ||
@@ -51,3 +51,9 @@ /** | ||
if (!part) { | ||
parent[key] = val; | ||
if (Array.isArray(parent[key])) { | ||
parent[key].push(val); | ||
} else if ('object' == typeof parent[key]) { | ||
parent[key] = val; | ||
} else { | ||
parent[key] = [parent[key], val]; | ||
} | ||
// array | ||
@@ -54,0 +60,0 @@ } else if (']' == part) { |
{ | ||
"name": "qs", | ||
"description": "querystring parser", | ||
"version": "0.0.7", | ||
"version": "0.1.0", | ||
"repository": {}, | ||
@@ -6,0 +6,0 @@ "author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)", |
@@ -86,2 +86,11 @@ | ||
.should.eql({ user: { names: ['tj', 'tyler'], email: 'tj@vision-media.ca' }}); | ||
qs.parse('items=a&items=b') | ||
.should.eql({ items: ['a', 'b'] }); | ||
qs.parse('user[names]=tj&user[names]=holowaychuk&user[names]=TJ') | ||
.should.eql({ user: { names: ['tj', 'holowaychuk', 'TJ'] }}); | ||
qs.parse('user[name][first]=tj&user[name][first]=TJ') | ||
.should.eql({ user: { name: { first: ['tj', 'TJ'] }}}); | ||
}, | ||
@@ -88,0 +97,0 @@ |
173579
1430