2626const {
2727 Array,
2828 ArrayIsArray,
29+ Int8Array,
2930 MathAbs,
3031 NumberIsFinite,
3132 ObjectCreate,
@@ -54,7 +55,7 @@ const QueryString = module.exports = {
5455 decode : parse
5556} ;
5657
57- const unhexTable = [
58+ const unhexTable = new Int8Array ( [
5859 - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , // 0 - 15
5960 - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , // 16 - 31
6061 - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , // 32 - 47
@@ -71,7 +72,7 @@ const unhexTable = [
7172 - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 ,
7273 - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 ,
7374 - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 // ... 255
74- ] ;
75+ ] ) ;
7576// A safe fast alternative to decodeURIComponent
7677function unescapeBuffer ( s , decodeSpaces ) {
7778 const out = Buffer . allocUnsafe ( s . length ) ;
@@ -131,7 +132,7 @@ function qsUnescape(s, decodeSpaces) {
131132// digits
132133// alpha (uppercase)
133134// alpha (lowercase)
134- const noEscape = [
135+ const noEscape = new Int8Array ( [
135136 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 0 - 15
136137 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 16 - 31
137138 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , // 32 - 47
@@ -140,7 +141,7 @@ const noEscape = [
140141 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , // 80 - 95
141142 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , // 96 - 111
142143 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 // 112 - 127
143- ] ;
144+ ] ) ;
144145// QueryString.escape() replaces encodeURIComponent()
145146// https://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3.4
146147function qsEscape ( str ) {
0 commit comments