|
@ -24,7 +24,11 @@ |
|
|
'use strict'; |
|
|
'use strict'; |
|
|
|
|
|
|
|
|
const { Buffer } = require('buffer'); |
|
|
const { Buffer } = require('buffer'); |
|
|
const { StorageObject, hexTable } = require('internal/querystring'); |
|
|
const { |
|
|
|
|
|
StorageObject, |
|
|
|
|
|
hexTable, |
|
|
|
|
|
isHexTable |
|
|
|
|
|
} = require('internal/querystring'); |
|
|
const QueryString = module.exports = { |
|
|
const QueryString = module.exports = { |
|
|
unescapeBuffer, |
|
|
unescapeBuffer, |
|
|
// `unescape()` is a JS global, so we need to use a different local name
|
|
|
// `unescape()` is a JS global, so we need to use a different local name
|
|
@ -264,25 +268,6 @@ function stringify(obj, sep, eq, options) { |
|
|
return ''; |
|
|
return ''; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const isHexTable = [ |
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15
|
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31
|
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 32 - 47
|
|
|
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63
|
|
|
|
|
|
0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 64 - 79
|
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 80 - 95
|
|
|
|
|
|
0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 96 - 111
|
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 112 - 127
|
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 128 ...
|
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // ... 256
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
function charCodes(str) { |
|
|
function charCodes(str) { |
|
|
if (str.length === 0) return []; |
|
|
if (str.length === 0) return []; |
|
|
if (str.length === 1) return [str.charCodeAt(0)]; |
|
|
if (str.length === 1) return [str.charCodeAt(0)]; |
|
|