Permalink
Browse files

exports decoder function

  • Loading branch information...
1 parent 9a49995 commit 8c0d5141cc92d385d9777c09f94412a49fffa0ce @hokaccha committed Aug 22, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/querystring.js
View
@@ -11,6 +11,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
}

0 comments on commit 8c0d514

Please sign in to comment.