mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
querystring: remove name from stringify()
QueryString.stringify() allowed a fourth argument that was used as a conditional in the return value, but was undocumented, not used by core and always was always false/undefiend. So the argument and conditional have been removed. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
This commit is contained in:
@@ -125,7 +125,7 @@ var stringifyPrimitive = function(v) {
|
||||
};
|
||||
|
||||
|
||||
QueryString.stringify = QueryString.encode = function(obj, sep, eq, name) {
|
||||
QueryString.stringify = QueryString.encode = function(obj, sep, eq) {
|
||||
sep = sep || '&';
|
||||
eq = eq || '=';
|
||||
if (util.isNull(obj)) {
|
||||
@@ -145,10 +145,7 @@ QueryString.stringify = QueryString.encode = function(obj, sep, eq, name) {
|
||||
}).join(sep);
|
||||
|
||||
}
|
||||
|
||||
if (!name) return '';
|
||||
return QueryString.escape(stringifyPrimitive(name)) + eq +
|
||||
QueryString.escape(stringifyPrimitive(obj));
|
||||
return '';
|
||||
};
|
||||
|
||||
// Parse a key=val string.
|
||||
|
||||
@@ -124,7 +124,7 @@ qsWeirdObjects.forEach(function(testCase) {
|
||||
});
|
||||
|
||||
qsNoMungeTestCases.forEach(function(testCase) {
|
||||
assert.deepEqual(testCase[0], qs.stringify(testCase[1], '&', '=', false));
|
||||
assert.deepEqual(testCase[0], qs.stringify(testCase[1], '&', '='));
|
||||
});
|
||||
|
||||
// test the nested qs-in-qs case
|
||||
|
||||
Reference in New Issue
Block a user