Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bugfix in querystring

  • Loading branch information...
commit b9cd3363efc6d249c86ebc2a8e5b523c968aaac9 1 parent 5c78c45
@ry ry authored
Showing with 5 additions and 1 deletion.
  1. +1 −1  lib/querystring.js
  2. +4 −0 test/simple/test-querystring.js
View
2  lib/querystring.js
@@ -68,7 +68,7 @@ QueryString.stringify = function (obj, sep, eq, name) {
};
QueryString.parseQuery = QueryString.parse = function (qs, sep, eq) {
- return qs
+ return (qs || '')
.split(sep||"&")
.map(pieceParser(eq||"="))
.reduce(mergeParams);
View
4 test/simple/test-querystring.js
@@ -114,6 +114,10 @@ var f = qs.stringify({
});
assert.equal(f, "a=b&q=x%3Dy%26y%3Dz");
+assert.doesNotThrow(function () {
+ qs.parse(undefined);
+});
+
// nested in colon
var f = qs.stringify({
a : "b",
Please sign in to comment.
Something went wrong with that request. Please try again.