mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
querystring: do not add sep for empty array
Currently, stringification of an empty array outputs a single separator character. This commit causes an empty array to output the empty string. Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
1 parent
e1ce8ba639
commit
61ddad1314
2 files changed
+18
-12
No files matched your search
@@ -57,7 +57,9 @@ var qsTestCases = [
|
||||
valueOf: 'bar',
|
||||
__defineGetter__: 'baz' }],
|
||||
// See: https://github.com/joyent/node/issues/3058
|
||||
['foo&bar=baz', 'foo=&bar=baz', { foo: '', bar: 'baz' }]
|
||||
['foo&bar=baz', 'foo=&bar=baz', { foo: '', bar: 'baz' }],
|
||||
[null, '', {}],
|
||||
[undefined, '', {}]
|
||||
];
|
||||
|
||||
// [ wonkyQS, canonicalQS, obj ]
|
||||
@@ -87,7 +89,8 @@ var qsWeirdObjects = [
|
||||
[{f: false, t: true}, 'f=false&t=true', {'f': 'false', 't': 'true'}],
|
||||
[{n: null}, 'n=', {'n': ''}],
|
||||
[{nan: NaN}, 'nan=', {'nan': ''}],
|
||||
[{inf: Infinity}, 'inf=', {'inf': ''}]
|
||||
[{inf: Infinity}, 'inf=', {'inf': ''}],
|
||||
[{a: [], b: []}, '', {}]
|
||||
];
|
||||
// }}}
|
||||
|
||||
|
||||
Reference in new issue
Block a user