From 8c0d5141cc92d385d9777c09f94412a49fffa0ce Mon Sep 17 00:00:00 2001 From: hokaccha Date: Tue, 23 Aug 2011 03:25:51 +0900 Subject: [PATCH] exports decoder function --- lib/querystring.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/querystring.js b/lib/querystring.js index 4246e96..0b15e76 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -10,6 +10,11 @@ exports.version = '0.3.1'; +/** + * Decode function. + */ +exports.decoder = decodeURIComponent; + /** * Object#toString() ref for stringify(). */ @@ -45,7 +50,7 @@ exports.parse = function(str){ .split('&') .reduce(function(ret, pair){ try{ - pair = decodeURIComponent(pair.replace(/\+/g, ' ')); + pair = exports.decoder(pair.replace(/\+/g, ' ')); } catch(e) { // ignore }