Skip to content

Commit

Permalink
exports decoder function
Browse files Browse the repository at this point in the history
  • Loading branch information
hokaccha committed Aug 22, 2011
1 parent 9a49995 commit 8c0d514
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/querystring.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

exports.version = '0.3.1';

/**
* Decode function.
*/
exports.decoder = decodeURIComponent;

/**
* Object#toString() ref for stringify().
*/
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 8c0d514

Please sign in to comment.