We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57d8172 commit 6ff12c4Copy full SHA for 6ff12c4
lib/querystring.js
@@ -10,7 +10,7 @@ function charCode (c) {
10
11
12
// a safe fast alternative to decodeURIComponent
13
-QueryString.unescape = function (s, decodeSpaces) {
+QueryString.unescapeBuffer = function (s, decodeSpaces) {
14
var out = new Buffer(s.length);
15
var state = "CHAR"; // states: CHAR, HEX0, HEX1
16
var n, m, hexchar;
@@ -72,7 +72,12 @@ QueryString.unescape = function (s, decodeSpaces) {
72
73
// TODO support returning arbitrary buffers.
74
75
- return out.toString('utf8', 0, outIndex-1);
+ return out.slice(0, outIndex-1);
76
+};
77
+
78
79
+QueryString.unescape = function (s, decodeSpaces) {
80
+ return QueryString.unescapeBuffer(s, decodeSpaces).toString();
81
};
82
83
0 commit comments