use correct API signature in querystring methods

This commit is contained in:
Feross Aboukhadijeh 2017-03-08 02:07:48 -08:00 committed by GitHub
parent e771c0f57e
commit 714400abae

View File

@ -52,7 +52,7 @@ exports.toUInt32 = toUInt32
* @return {Object}
*/
exports.querystringParse = function (q) {
return querystring.parse(q, { decodeURIComponent: unescape })
return querystring.parse(q, null, null, { decodeURIComponent: unescape })
}
/**
@ -62,7 +62,7 @@ exports.querystringParse = function (q) {
* @return {string}
*/
exports.querystringStringify = function (obj) {
var ret = querystring.stringify(obj, { encodeURIComponent: escape })
var ret = querystring.stringify(obj, null, null, { encodeURIComponent: escape })
ret = ret.replace(/[@*/+]/g, function (char) {
// `escape` doesn't encode the characters @*/+ so we do it manually
return '%' + char.charCodeAt(0).toString(16).toUpperCase()