@gjsify/querystring 0.3.16 → 0.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/error.js +1 -29
- package/lib/esm/index.js +1 -1055
- package/package.json +4 -4
- package/tsconfig.tsbuildinfo +1 -1
package/lib/esm/index.js
CHANGED
|
@@ -1,1055 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Buffer } from "node:buffer";
|
|
3
|
-
|
|
4
|
-
//#region src/index.ts
|
|
5
|
-
const hexTable = new Array(256);
|
|
6
|
-
for (let i = 0; i < 256; ++i) {
|
|
7
|
-
hexTable[i] = "%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase();
|
|
8
|
-
}
|
|
9
|
-
function encodeStr(str, noEscapeTable, hexTable) {
|
|
10
|
-
const len = str.length;
|
|
11
|
-
if (len === 0) return "";
|
|
12
|
-
let out = "";
|
|
13
|
-
let lastPos = 0;
|
|
14
|
-
for (let i = 0; i < len; i++) {
|
|
15
|
-
let c = str.charCodeAt(i);
|
|
16
|
-
if (c < 128) {
|
|
17
|
-
if (noEscapeTable[c] === 1) continue;
|
|
18
|
-
if (lastPos < i) out += str.slice(lastPos, i);
|
|
19
|
-
lastPos = i + 1;
|
|
20
|
-
out += hexTable[c];
|
|
21
|
-
continue;
|
|
22
|
-
}
|
|
23
|
-
if (lastPos < i) out += str.slice(lastPos, i);
|
|
24
|
-
if (c < 2048) {
|
|
25
|
-
lastPos = i + 1;
|
|
26
|
-
out += hexTable[192 | c >> 6] + hexTable[128 | c & 63];
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
if (c < 55296 || c >= 57344) {
|
|
30
|
-
lastPos = i + 1;
|
|
31
|
-
out += hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
++i;
|
|
35
|
-
if (i >= len) throw new ERR_INVALID_URI();
|
|
36
|
-
const c2 = str.charCodeAt(i) & 1023;
|
|
37
|
-
lastPos = i + 1;
|
|
38
|
-
c = 65536 + ((c & 1023) << 10 | c2);
|
|
39
|
-
out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
|
|
40
|
-
}
|
|
41
|
-
if (lastPos === 0) return str;
|
|
42
|
-
if (lastPos < len) return out + str.slice(lastPos);
|
|
43
|
-
return out;
|
|
44
|
-
}
|
|
45
|
-
var ERR_INVALID_URI = class extends NodeURIError {
|
|
46
|
-
constructor() {
|
|
47
|
-
super("ERR_INVALID_URI", `URI malformed`);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Alias of querystring.parse()
|
|
52
|
-
* @legacy
|
|
53
|
-
*/
|
|
54
|
-
const decode = parse;
|
|
55
|
-
/**
|
|
56
|
-
* Alias of querystring.stringify()
|
|
57
|
-
* @legacy
|
|
58
|
-
*/
|
|
59
|
-
const encode = stringify;
|
|
60
|
-
/**
|
|
61
|
-
* replaces encodeURIComponent()
|
|
62
|
-
* @see https://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3.4
|
|
63
|
-
*/
|
|
64
|
-
function qsEscape(str) {
|
|
65
|
-
if (typeof str !== "string") {
|
|
66
|
-
if (typeof str === "object") {
|
|
67
|
-
str = String(str);
|
|
68
|
-
} else {
|
|
69
|
-
str += "";
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return encodeStr(str, noEscape, hexTable);
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Performs URL percent-encoding on the given `str` in a manner that is optimized for the specific requirements of URL query strings.
|
|
76
|
-
* Used by `querystring.stringify()` and is generally not expected to be used directly.
|
|
77
|
-
* It is exported primarily to allow application code to provide a replacement percent-encoding implementation if necessary by assigning `querystring.escape` to an alternative function.
|
|
78
|
-
* @legacy
|
|
79
|
-
* @see Tested in `test-querystring-escape.js`
|
|
80
|
-
*/
|
|
81
|
-
const escape = qsEscape;
|
|
82
|
-
const isHexTable = new Int8Array([
|
|
83
|
-
0,
|
|
84
|
-
0,
|
|
85
|
-
0,
|
|
86
|
-
0,
|
|
87
|
-
0,
|
|
88
|
-
0,
|
|
89
|
-
0,
|
|
90
|
-
0,
|
|
91
|
-
0,
|
|
92
|
-
0,
|
|
93
|
-
0,
|
|
94
|
-
0,
|
|
95
|
-
0,
|
|
96
|
-
0,
|
|
97
|
-
0,
|
|
98
|
-
0,
|
|
99
|
-
0,
|
|
100
|
-
0,
|
|
101
|
-
0,
|
|
102
|
-
0,
|
|
103
|
-
0,
|
|
104
|
-
0,
|
|
105
|
-
0,
|
|
106
|
-
0,
|
|
107
|
-
0,
|
|
108
|
-
0,
|
|
109
|
-
0,
|
|
110
|
-
0,
|
|
111
|
-
0,
|
|
112
|
-
0,
|
|
113
|
-
0,
|
|
114
|
-
0,
|
|
115
|
-
0,
|
|
116
|
-
0,
|
|
117
|
-
0,
|
|
118
|
-
0,
|
|
119
|
-
0,
|
|
120
|
-
0,
|
|
121
|
-
0,
|
|
122
|
-
0,
|
|
123
|
-
0,
|
|
124
|
-
0,
|
|
125
|
-
0,
|
|
126
|
-
0,
|
|
127
|
-
0,
|
|
128
|
-
0,
|
|
129
|
-
0,
|
|
130
|
-
0,
|
|
131
|
-
1,
|
|
132
|
-
1,
|
|
133
|
-
1,
|
|
134
|
-
1,
|
|
135
|
-
1,
|
|
136
|
-
1,
|
|
137
|
-
1,
|
|
138
|
-
1,
|
|
139
|
-
1,
|
|
140
|
-
1,
|
|
141
|
-
0,
|
|
142
|
-
0,
|
|
143
|
-
0,
|
|
144
|
-
0,
|
|
145
|
-
0,
|
|
146
|
-
0,
|
|
147
|
-
0,
|
|
148
|
-
1,
|
|
149
|
-
1,
|
|
150
|
-
1,
|
|
151
|
-
1,
|
|
152
|
-
1,
|
|
153
|
-
1,
|
|
154
|
-
0,
|
|
155
|
-
0,
|
|
156
|
-
0,
|
|
157
|
-
0,
|
|
158
|
-
0,
|
|
159
|
-
0,
|
|
160
|
-
0,
|
|
161
|
-
0,
|
|
162
|
-
0,
|
|
163
|
-
0,
|
|
164
|
-
0,
|
|
165
|
-
0,
|
|
166
|
-
0,
|
|
167
|
-
0,
|
|
168
|
-
0,
|
|
169
|
-
0,
|
|
170
|
-
0,
|
|
171
|
-
0,
|
|
172
|
-
0,
|
|
173
|
-
0,
|
|
174
|
-
0,
|
|
175
|
-
0,
|
|
176
|
-
0,
|
|
177
|
-
0,
|
|
178
|
-
0,
|
|
179
|
-
0,
|
|
180
|
-
1,
|
|
181
|
-
1,
|
|
182
|
-
1,
|
|
183
|
-
1,
|
|
184
|
-
1,
|
|
185
|
-
1,
|
|
186
|
-
0,
|
|
187
|
-
0,
|
|
188
|
-
0,
|
|
189
|
-
0,
|
|
190
|
-
0,
|
|
191
|
-
0,
|
|
192
|
-
0,
|
|
193
|
-
0,
|
|
194
|
-
0,
|
|
195
|
-
0,
|
|
196
|
-
0,
|
|
197
|
-
0,
|
|
198
|
-
0,
|
|
199
|
-
0,
|
|
200
|
-
0,
|
|
201
|
-
0,
|
|
202
|
-
0,
|
|
203
|
-
0,
|
|
204
|
-
0,
|
|
205
|
-
0,
|
|
206
|
-
0,
|
|
207
|
-
0,
|
|
208
|
-
0,
|
|
209
|
-
0,
|
|
210
|
-
0,
|
|
211
|
-
0,
|
|
212
|
-
0,
|
|
213
|
-
0,
|
|
214
|
-
0,
|
|
215
|
-
0,
|
|
216
|
-
0,
|
|
217
|
-
0,
|
|
218
|
-
0,
|
|
219
|
-
0,
|
|
220
|
-
0,
|
|
221
|
-
0,
|
|
222
|
-
0,
|
|
223
|
-
0,
|
|
224
|
-
0,
|
|
225
|
-
0,
|
|
226
|
-
0,
|
|
227
|
-
0,
|
|
228
|
-
0,
|
|
229
|
-
0,
|
|
230
|
-
0,
|
|
231
|
-
0,
|
|
232
|
-
0,
|
|
233
|
-
0,
|
|
234
|
-
0,
|
|
235
|
-
0,
|
|
236
|
-
0,
|
|
237
|
-
0,
|
|
238
|
-
0,
|
|
239
|
-
0,
|
|
240
|
-
0,
|
|
241
|
-
0,
|
|
242
|
-
0,
|
|
243
|
-
0,
|
|
244
|
-
0,
|
|
245
|
-
0,
|
|
246
|
-
0,
|
|
247
|
-
0,
|
|
248
|
-
0,
|
|
249
|
-
0,
|
|
250
|
-
0,
|
|
251
|
-
0,
|
|
252
|
-
0,
|
|
253
|
-
0,
|
|
254
|
-
0,
|
|
255
|
-
0,
|
|
256
|
-
0,
|
|
257
|
-
0,
|
|
258
|
-
0,
|
|
259
|
-
0,
|
|
260
|
-
0,
|
|
261
|
-
0,
|
|
262
|
-
0,
|
|
263
|
-
0,
|
|
264
|
-
0,
|
|
265
|
-
0,
|
|
266
|
-
0,
|
|
267
|
-
0,
|
|
268
|
-
0,
|
|
269
|
-
0,
|
|
270
|
-
0,
|
|
271
|
-
0,
|
|
272
|
-
0,
|
|
273
|
-
0,
|
|
274
|
-
0,
|
|
275
|
-
0,
|
|
276
|
-
0,
|
|
277
|
-
0,
|
|
278
|
-
0,
|
|
279
|
-
0,
|
|
280
|
-
0,
|
|
281
|
-
0,
|
|
282
|
-
0,
|
|
283
|
-
0,
|
|
284
|
-
0,
|
|
285
|
-
0,
|
|
286
|
-
0,
|
|
287
|
-
0,
|
|
288
|
-
0,
|
|
289
|
-
0,
|
|
290
|
-
0,
|
|
291
|
-
0,
|
|
292
|
-
0,
|
|
293
|
-
0,
|
|
294
|
-
0,
|
|
295
|
-
0,
|
|
296
|
-
0,
|
|
297
|
-
0,
|
|
298
|
-
0,
|
|
299
|
-
0,
|
|
300
|
-
0,
|
|
301
|
-
0,
|
|
302
|
-
0,
|
|
303
|
-
0,
|
|
304
|
-
0,
|
|
305
|
-
0,
|
|
306
|
-
0,
|
|
307
|
-
0,
|
|
308
|
-
0,
|
|
309
|
-
0,
|
|
310
|
-
0,
|
|
311
|
-
0,
|
|
312
|
-
0,
|
|
313
|
-
0,
|
|
314
|
-
0,
|
|
315
|
-
0,
|
|
316
|
-
0,
|
|
317
|
-
0,
|
|
318
|
-
0,
|
|
319
|
-
0,
|
|
320
|
-
0,
|
|
321
|
-
0,
|
|
322
|
-
0,
|
|
323
|
-
0,
|
|
324
|
-
0,
|
|
325
|
-
0,
|
|
326
|
-
0,
|
|
327
|
-
0,
|
|
328
|
-
0,
|
|
329
|
-
0,
|
|
330
|
-
0,
|
|
331
|
-
0,
|
|
332
|
-
0,
|
|
333
|
-
0,
|
|
334
|
-
0,
|
|
335
|
-
0,
|
|
336
|
-
0,
|
|
337
|
-
0,
|
|
338
|
-
0
|
|
339
|
-
]);
|
|
340
|
-
function charCodes(str) {
|
|
341
|
-
const ret = new Array(str.length);
|
|
342
|
-
for (let i = 0; i < str.length; ++i) {
|
|
343
|
-
ret[i] = str.charCodeAt(i);
|
|
344
|
-
}
|
|
345
|
-
return ret;
|
|
346
|
-
}
|
|
347
|
-
function addKeyVal(obj, key, value, keyEncoded, valEncoded, decode) {
|
|
348
|
-
if (key.length > 0 && keyEncoded) {
|
|
349
|
-
try {
|
|
350
|
-
key = decode(key);
|
|
351
|
-
} catch {}
|
|
352
|
-
}
|
|
353
|
-
if (value.length > 0 && valEncoded) {
|
|
354
|
-
try {
|
|
355
|
-
value = decode(value);
|
|
356
|
-
} catch {}
|
|
357
|
-
}
|
|
358
|
-
if (obj[key] === undefined) {
|
|
359
|
-
obj[key] = value;
|
|
360
|
-
} else {
|
|
361
|
-
const curValue = obj[key];
|
|
362
|
-
if (curValue.pop) {
|
|
363
|
-
curValue[curValue.length] = value;
|
|
364
|
-
} else {
|
|
365
|
-
obj[key] = [curValue, value];
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Parses a URL query string into a collection of key and value pairs.
|
|
371
|
-
* @param str The URL query string to parse
|
|
372
|
-
* @param sep The substring used to delimit key and value pairs in the query string. Default: '&'.
|
|
373
|
-
* @param eq The substring used to delimit keys and values in the query string. Default: '='.
|
|
374
|
-
* @param options The parse options
|
|
375
|
-
* @param options.decodeURIComponent The function to use when decoding percent-encoded characters in the query string. Default: `querystring.unescape()`.
|
|
376
|
-
* @param options.maxKeys Specifies the maximum number of keys to parse. Specify `0` to remove key counting limitations. Default: `1000`.
|
|
377
|
-
* @legacy
|
|
378
|
-
* @see Tested in test-querystring.js
|
|
379
|
-
*/
|
|
380
|
-
function parse(str, sep = "&", eq = "=", { decodeURIComponent = unescape, maxKeys = 1e3 } = {}) {
|
|
381
|
-
const obj = Object.create(null);
|
|
382
|
-
if (typeof str !== "string" || str.length === 0) {
|
|
383
|
-
return obj;
|
|
384
|
-
}
|
|
385
|
-
const sepCodes = !sep ? [38] : charCodes(String(sep));
|
|
386
|
-
const eqCodes = !eq ? [61] : charCodes(String(eq));
|
|
387
|
-
const sepLen = sepCodes.length;
|
|
388
|
-
const eqLen = eqCodes.length;
|
|
389
|
-
let pairs = 1e3;
|
|
390
|
-
if (typeof maxKeys === "number") {
|
|
391
|
-
pairs = maxKeys > 0 ? maxKeys : -1;
|
|
392
|
-
}
|
|
393
|
-
let decode = unescape;
|
|
394
|
-
if (decodeURIComponent) {
|
|
395
|
-
decode = decodeURIComponent;
|
|
396
|
-
}
|
|
397
|
-
const customDecode = decode !== unescape;
|
|
398
|
-
let lastPos = 0;
|
|
399
|
-
let sepIdx = 0;
|
|
400
|
-
let eqIdx = 0;
|
|
401
|
-
let key = "";
|
|
402
|
-
let value = "";
|
|
403
|
-
let keyEncoded = customDecode;
|
|
404
|
-
let valEncoded = customDecode;
|
|
405
|
-
const plusChar = customDecode ? "%20" : " ";
|
|
406
|
-
let encodeCheck = 0;
|
|
407
|
-
for (let i = 0; i < str.length; ++i) {
|
|
408
|
-
const code = str.charCodeAt(i);
|
|
409
|
-
if (code === sepCodes[sepIdx]) {
|
|
410
|
-
if (++sepIdx === sepLen) {
|
|
411
|
-
const end = i - sepIdx + 1;
|
|
412
|
-
if (eqIdx < eqLen) {
|
|
413
|
-
if (lastPos < end) {
|
|
414
|
-
key += str.slice(lastPos, end);
|
|
415
|
-
} else if (key.length === 0) {
|
|
416
|
-
if (--pairs === 0) {
|
|
417
|
-
return obj;
|
|
418
|
-
}
|
|
419
|
-
lastPos = i + 1;
|
|
420
|
-
sepIdx = eqIdx = 0;
|
|
421
|
-
continue;
|
|
422
|
-
}
|
|
423
|
-
} else if (lastPos < end) {
|
|
424
|
-
value += str.slice(lastPos, end);
|
|
425
|
-
}
|
|
426
|
-
addKeyVal(obj, key, value, keyEncoded, valEncoded, decode);
|
|
427
|
-
if (--pairs === 0) {
|
|
428
|
-
return obj;
|
|
429
|
-
}
|
|
430
|
-
key = value = "";
|
|
431
|
-
encodeCheck = 0;
|
|
432
|
-
lastPos = i + 1;
|
|
433
|
-
sepIdx = eqIdx = 0;
|
|
434
|
-
}
|
|
435
|
-
} else {
|
|
436
|
-
sepIdx = 0;
|
|
437
|
-
if (eqIdx < eqLen) {
|
|
438
|
-
if (code === eqCodes[eqIdx]) {
|
|
439
|
-
if (++eqIdx === eqLen) {
|
|
440
|
-
const end = i - eqIdx + 1;
|
|
441
|
-
if (lastPos < end) {
|
|
442
|
-
key += str.slice(lastPos, end);
|
|
443
|
-
}
|
|
444
|
-
encodeCheck = 0;
|
|
445
|
-
lastPos = i + 1;
|
|
446
|
-
}
|
|
447
|
-
continue;
|
|
448
|
-
} else {
|
|
449
|
-
eqIdx = 0;
|
|
450
|
-
if (!keyEncoded) {
|
|
451
|
-
if (code === 37) {
|
|
452
|
-
encodeCheck = 1;
|
|
453
|
-
continue;
|
|
454
|
-
} else if (encodeCheck > 0) {
|
|
455
|
-
if (isHexTable[code] === 1) {
|
|
456
|
-
if (++encodeCheck === 3) {
|
|
457
|
-
keyEncoded = true;
|
|
458
|
-
}
|
|
459
|
-
continue;
|
|
460
|
-
} else {
|
|
461
|
-
encodeCheck = 0;
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
if (code === 43) {
|
|
467
|
-
if (lastPos < i) {
|
|
468
|
-
key += str.slice(lastPos, i);
|
|
469
|
-
}
|
|
470
|
-
key += plusChar;
|
|
471
|
-
lastPos = i + 1;
|
|
472
|
-
continue;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
if (code === 43) {
|
|
476
|
-
if (lastPos < i) {
|
|
477
|
-
value += str.slice(lastPos, i);
|
|
478
|
-
}
|
|
479
|
-
value += plusChar;
|
|
480
|
-
lastPos = i + 1;
|
|
481
|
-
} else if (!valEncoded) {
|
|
482
|
-
if (code === 37) {
|
|
483
|
-
encodeCheck = 1;
|
|
484
|
-
} else if (encodeCheck > 0) {
|
|
485
|
-
if (isHexTable[code] === 1) {
|
|
486
|
-
if (++encodeCheck === 3) {
|
|
487
|
-
valEncoded = true;
|
|
488
|
-
}
|
|
489
|
-
} else {
|
|
490
|
-
encodeCheck = 0;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
if (lastPos < str.length) {
|
|
497
|
-
if (eqIdx < eqLen) {
|
|
498
|
-
key += str.slice(lastPos);
|
|
499
|
-
} else if (sepIdx < sepLen) {
|
|
500
|
-
value += str.slice(lastPos);
|
|
501
|
-
}
|
|
502
|
-
} else if (eqIdx === 0 && key.length === 0) {
|
|
503
|
-
return obj;
|
|
504
|
-
}
|
|
505
|
-
addKeyVal(obj, key, value, keyEncoded, valEncoded, decode);
|
|
506
|
-
return obj;
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* These characters do not need escaping when generating query strings:
|
|
510
|
-
* ! - . _ ~
|
|
511
|
-
* ' ( ) *
|
|
512
|
-
* digits
|
|
513
|
-
* alpha (uppercase)
|
|
514
|
-
* alpha (lowercase)
|
|
515
|
-
*/
|
|
516
|
-
const noEscape = new Int8Array([
|
|
517
|
-
0,
|
|
518
|
-
0,
|
|
519
|
-
0,
|
|
520
|
-
0,
|
|
521
|
-
0,
|
|
522
|
-
0,
|
|
523
|
-
0,
|
|
524
|
-
0,
|
|
525
|
-
0,
|
|
526
|
-
0,
|
|
527
|
-
0,
|
|
528
|
-
0,
|
|
529
|
-
0,
|
|
530
|
-
0,
|
|
531
|
-
0,
|
|
532
|
-
0,
|
|
533
|
-
0,
|
|
534
|
-
0,
|
|
535
|
-
0,
|
|
536
|
-
0,
|
|
537
|
-
0,
|
|
538
|
-
0,
|
|
539
|
-
0,
|
|
540
|
-
0,
|
|
541
|
-
0,
|
|
542
|
-
0,
|
|
543
|
-
0,
|
|
544
|
-
0,
|
|
545
|
-
0,
|
|
546
|
-
0,
|
|
547
|
-
0,
|
|
548
|
-
0,
|
|
549
|
-
0,
|
|
550
|
-
1,
|
|
551
|
-
0,
|
|
552
|
-
0,
|
|
553
|
-
0,
|
|
554
|
-
0,
|
|
555
|
-
0,
|
|
556
|
-
1,
|
|
557
|
-
1,
|
|
558
|
-
1,
|
|
559
|
-
1,
|
|
560
|
-
0,
|
|
561
|
-
0,
|
|
562
|
-
1,
|
|
563
|
-
1,
|
|
564
|
-
0,
|
|
565
|
-
1,
|
|
566
|
-
1,
|
|
567
|
-
1,
|
|
568
|
-
1,
|
|
569
|
-
1,
|
|
570
|
-
1,
|
|
571
|
-
1,
|
|
572
|
-
1,
|
|
573
|
-
1,
|
|
574
|
-
1,
|
|
575
|
-
0,
|
|
576
|
-
0,
|
|
577
|
-
0,
|
|
578
|
-
0,
|
|
579
|
-
0,
|
|
580
|
-
0,
|
|
581
|
-
0,
|
|
582
|
-
1,
|
|
583
|
-
1,
|
|
584
|
-
1,
|
|
585
|
-
1,
|
|
586
|
-
1,
|
|
587
|
-
1,
|
|
588
|
-
1,
|
|
589
|
-
1,
|
|
590
|
-
1,
|
|
591
|
-
1,
|
|
592
|
-
1,
|
|
593
|
-
1,
|
|
594
|
-
1,
|
|
595
|
-
1,
|
|
596
|
-
1,
|
|
597
|
-
1,
|
|
598
|
-
1,
|
|
599
|
-
1,
|
|
600
|
-
1,
|
|
601
|
-
1,
|
|
602
|
-
1,
|
|
603
|
-
1,
|
|
604
|
-
1,
|
|
605
|
-
1,
|
|
606
|
-
1,
|
|
607
|
-
1,
|
|
608
|
-
0,
|
|
609
|
-
0,
|
|
610
|
-
0,
|
|
611
|
-
0,
|
|
612
|
-
1,
|
|
613
|
-
0,
|
|
614
|
-
1,
|
|
615
|
-
1,
|
|
616
|
-
1,
|
|
617
|
-
1,
|
|
618
|
-
1,
|
|
619
|
-
1,
|
|
620
|
-
1,
|
|
621
|
-
1,
|
|
622
|
-
1,
|
|
623
|
-
1,
|
|
624
|
-
1,
|
|
625
|
-
1,
|
|
626
|
-
1,
|
|
627
|
-
1,
|
|
628
|
-
1,
|
|
629
|
-
1,
|
|
630
|
-
1,
|
|
631
|
-
1,
|
|
632
|
-
1,
|
|
633
|
-
1,
|
|
634
|
-
1,
|
|
635
|
-
1,
|
|
636
|
-
1,
|
|
637
|
-
1,
|
|
638
|
-
1,
|
|
639
|
-
1,
|
|
640
|
-
0,
|
|
641
|
-
0,
|
|
642
|
-
0,
|
|
643
|
-
1,
|
|
644
|
-
0
|
|
645
|
-
]);
|
|
646
|
-
function stringifyPrimitive(v) {
|
|
647
|
-
if (typeof v === "string") {
|
|
648
|
-
return v;
|
|
649
|
-
}
|
|
650
|
-
if (typeof v === "number" && isFinite(v)) {
|
|
651
|
-
return "" + v;
|
|
652
|
-
}
|
|
653
|
-
if (typeof v === "bigint") {
|
|
654
|
-
return "" + v;
|
|
655
|
-
}
|
|
656
|
-
if (typeof v === "boolean") {
|
|
657
|
-
return v ? "true" : "false";
|
|
658
|
-
}
|
|
659
|
-
return "";
|
|
660
|
-
}
|
|
661
|
-
function encodeStringifiedCustom(v, encode) {
|
|
662
|
-
return encode(stringifyPrimitive(v));
|
|
663
|
-
}
|
|
664
|
-
function encodeStringified(v, encode) {
|
|
665
|
-
if (typeof v === "string") {
|
|
666
|
-
return v.length ? encode(v) : "";
|
|
667
|
-
}
|
|
668
|
-
if (typeof v === "number" && isFinite(v)) {
|
|
669
|
-
return Math.abs(v) < 1e21 ? "" + v : encode("" + v);
|
|
670
|
-
}
|
|
671
|
-
if (typeof v === "bigint") {
|
|
672
|
-
return "" + v;
|
|
673
|
-
}
|
|
674
|
-
if (typeof v === "boolean") {
|
|
675
|
-
return v ? "true" : "false";
|
|
676
|
-
}
|
|
677
|
-
return "";
|
|
678
|
-
}
|
|
679
|
-
/**
|
|
680
|
-
* Produces a URL query string from a given obj by iterating through the object's "own properties".
|
|
681
|
-
* @param obj The object to serialize into a URL query string.
|
|
682
|
-
* @param sep The substring used to delimit key and value pairs in the query string. Default: '&'.
|
|
683
|
-
* @param eq The substring used to delimit keys and values in the query string. Default: '='.
|
|
684
|
-
* @param options The stringify options
|
|
685
|
-
* @param options.encodeURIComponent The function to use when converting URL-unsafe characters to percent-encoding in the query string. Default: `querystring.escape()`.
|
|
686
|
-
* @legacy
|
|
687
|
-
* @see Tested in `test-querystring.js`
|
|
688
|
-
*/
|
|
689
|
-
function stringify(obj, sep, eq, options) {
|
|
690
|
-
sep ||= "&";
|
|
691
|
-
eq ||= "=";
|
|
692
|
-
const encode = options ? options.encodeURIComponent : qsEscape;
|
|
693
|
-
const convert = options ? encodeStringifiedCustom : encodeStringified;
|
|
694
|
-
if (obj !== null && typeof obj === "object") {
|
|
695
|
-
const keys = Object.keys(obj);
|
|
696
|
-
const len = keys.length;
|
|
697
|
-
let fields = "";
|
|
698
|
-
for (let i = 0; i < len; ++i) {
|
|
699
|
-
const k = keys[i];
|
|
700
|
-
const v = obj[k];
|
|
701
|
-
let ks = convert(k, encode);
|
|
702
|
-
ks += eq;
|
|
703
|
-
if (Array.isArray(v)) {
|
|
704
|
-
const vlen = v.length;
|
|
705
|
-
if (vlen === 0) continue;
|
|
706
|
-
if (fields) {
|
|
707
|
-
fields += sep;
|
|
708
|
-
}
|
|
709
|
-
for (let j = 0; j < vlen; ++j) {
|
|
710
|
-
if (j) {
|
|
711
|
-
fields += sep;
|
|
712
|
-
}
|
|
713
|
-
fields += ks;
|
|
714
|
-
fields += convert(v[j], encode);
|
|
715
|
-
}
|
|
716
|
-
} else {
|
|
717
|
-
if (fields) {
|
|
718
|
-
fields += sep;
|
|
719
|
-
}
|
|
720
|
-
fields += ks;
|
|
721
|
-
fields += convert(v, encode);
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
return fields;
|
|
725
|
-
}
|
|
726
|
-
return "";
|
|
727
|
-
}
|
|
728
|
-
const unhexTable = new Int8Array([
|
|
729
|
-
-1,
|
|
730
|
-
-1,
|
|
731
|
-
-1,
|
|
732
|
-
-1,
|
|
733
|
-
-1,
|
|
734
|
-
-1,
|
|
735
|
-
-1,
|
|
736
|
-
-1,
|
|
737
|
-
-1,
|
|
738
|
-
-1,
|
|
739
|
-
-1,
|
|
740
|
-
-1,
|
|
741
|
-
-1,
|
|
742
|
-
-1,
|
|
743
|
-
-1,
|
|
744
|
-
-1,
|
|
745
|
-
-1,
|
|
746
|
-
-1,
|
|
747
|
-
-1,
|
|
748
|
-
-1,
|
|
749
|
-
-1,
|
|
750
|
-
-1,
|
|
751
|
-
-1,
|
|
752
|
-
-1,
|
|
753
|
-
-1,
|
|
754
|
-
-1,
|
|
755
|
-
-1,
|
|
756
|
-
-1,
|
|
757
|
-
-1,
|
|
758
|
-
-1,
|
|
759
|
-
-1,
|
|
760
|
-
-1,
|
|
761
|
-
-1,
|
|
762
|
-
-1,
|
|
763
|
-
-1,
|
|
764
|
-
-1,
|
|
765
|
-
-1,
|
|
766
|
-
-1,
|
|
767
|
-
-1,
|
|
768
|
-
-1,
|
|
769
|
-
-1,
|
|
770
|
-
-1,
|
|
771
|
-
-1,
|
|
772
|
-
-1,
|
|
773
|
-
-1,
|
|
774
|
-
-1,
|
|
775
|
-
-1,
|
|
776
|
-
-1,
|
|
777
|
-
+0,
|
|
778
|
-
+1,
|
|
779
|
-
+2,
|
|
780
|
-
+3,
|
|
781
|
-
+4,
|
|
782
|
-
+5,
|
|
783
|
-
+6,
|
|
784
|
-
+7,
|
|
785
|
-
+8,
|
|
786
|
-
+9,
|
|
787
|
-
-1,
|
|
788
|
-
-1,
|
|
789
|
-
-1,
|
|
790
|
-
-1,
|
|
791
|
-
-1,
|
|
792
|
-
-1,
|
|
793
|
-
-1,
|
|
794
|
-
10,
|
|
795
|
-
11,
|
|
796
|
-
12,
|
|
797
|
-
13,
|
|
798
|
-
14,
|
|
799
|
-
15,
|
|
800
|
-
-1,
|
|
801
|
-
-1,
|
|
802
|
-
-1,
|
|
803
|
-
-1,
|
|
804
|
-
-1,
|
|
805
|
-
-1,
|
|
806
|
-
-1,
|
|
807
|
-
-1,
|
|
808
|
-
-1,
|
|
809
|
-
-1,
|
|
810
|
-
-1,
|
|
811
|
-
-1,
|
|
812
|
-
-1,
|
|
813
|
-
-1,
|
|
814
|
-
-1,
|
|
815
|
-
-1,
|
|
816
|
-
-1,
|
|
817
|
-
-1,
|
|
818
|
-
-1,
|
|
819
|
-
-1,
|
|
820
|
-
-1,
|
|
821
|
-
-1,
|
|
822
|
-
-1,
|
|
823
|
-
-1,
|
|
824
|
-
-1,
|
|
825
|
-
-1,
|
|
826
|
-
10,
|
|
827
|
-
11,
|
|
828
|
-
12,
|
|
829
|
-
13,
|
|
830
|
-
14,
|
|
831
|
-
15,
|
|
832
|
-
-1,
|
|
833
|
-
-1,
|
|
834
|
-
-1,
|
|
835
|
-
-1,
|
|
836
|
-
-1,
|
|
837
|
-
-1,
|
|
838
|
-
-1,
|
|
839
|
-
-1,
|
|
840
|
-
-1,
|
|
841
|
-
-1,
|
|
842
|
-
-1,
|
|
843
|
-
-1,
|
|
844
|
-
-1,
|
|
845
|
-
-1,
|
|
846
|
-
-1,
|
|
847
|
-
-1,
|
|
848
|
-
-1,
|
|
849
|
-
-1,
|
|
850
|
-
-1,
|
|
851
|
-
-1,
|
|
852
|
-
-1,
|
|
853
|
-
-1,
|
|
854
|
-
-1,
|
|
855
|
-
-1,
|
|
856
|
-
-1,
|
|
857
|
-
-1,
|
|
858
|
-
-1,
|
|
859
|
-
-1,
|
|
860
|
-
-1,
|
|
861
|
-
-1,
|
|
862
|
-
-1,
|
|
863
|
-
-1,
|
|
864
|
-
-1,
|
|
865
|
-
-1,
|
|
866
|
-
-1,
|
|
867
|
-
-1,
|
|
868
|
-
-1,
|
|
869
|
-
-1,
|
|
870
|
-
-1,
|
|
871
|
-
-1,
|
|
872
|
-
-1,
|
|
873
|
-
-1,
|
|
874
|
-
-1,
|
|
875
|
-
-1,
|
|
876
|
-
-1,
|
|
877
|
-
-1,
|
|
878
|
-
-1,
|
|
879
|
-
-1,
|
|
880
|
-
-1,
|
|
881
|
-
-1,
|
|
882
|
-
-1,
|
|
883
|
-
-1,
|
|
884
|
-
-1,
|
|
885
|
-
-1,
|
|
886
|
-
-1,
|
|
887
|
-
-1,
|
|
888
|
-
-1,
|
|
889
|
-
-1,
|
|
890
|
-
-1,
|
|
891
|
-
-1,
|
|
892
|
-
-1,
|
|
893
|
-
-1,
|
|
894
|
-
-1,
|
|
895
|
-
-1,
|
|
896
|
-
-1,
|
|
897
|
-
-1,
|
|
898
|
-
-1,
|
|
899
|
-
-1,
|
|
900
|
-
-1,
|
|
901
|
-
-1,
|
|
902
|
-
-1,
|
|
903
|
-
-1,
|
|
904
|
-
-1,
|
|
905
|
-
-1,
|
|
906
|
-
-1,
|
|
907
|
-
-1,
|
|
908
|
-
-1,
|
|
909
|
-
-1,
|
|
910
|
-
-1,
|
|
911
|
-
-1,
|
|
912
|
-
-1,
|
|
913
|
-
-1,
|
|
914
|
-
-1,
|
|
915
|
-
-1,
|
|
916
|
-
-1,
|
|
917
|
-
-1,
|
|
918
|
-
-1,
|
|
919
|
-
-1,
|
|
920
|
-
-1,
|
|
921
|
-
-1,
|
|
922
|
-
-1,
|
|
923
|
-
-1,
|
|
924
|
-
-1,
|
|
925
|
-
-1,
|
|
926
|
-
-1,
|
|
927
|
-
-1,
|
|
928
|
-
-1,
|
|
929
|
-
-1,
|
|
930
|
-
-1,
|
|
931
|
-
-1,
|
|
932
|
-
-1,
|
|
933
|
-
-1,
|
|
934
|
-
-1,
|
|
935
|
-
-1,
|
|
936
|
-
-1,
|
|
937
|
-
-1,
|
|
938
|
-
-1,
|
|
939
|
-
-1,
|
|
940
|
-
-1,
|
|
941
|
-
-1,
|
|
942
|
-
-1,
|
|
943
|
-
-1,
|
|
944
|
-
-1,
|
|
945
|
-
-1,
|
|
946
|
-
-1,
|
|
947
|
-
-1,
|
|
948
|
-
-1,
|
|
949
|
-
-1,
|
|
950
|
-
-1,
|
|
951
|
-
-1,
|
|
952
|
-
-1,
|
|
953
|
-
-1,
|
|
954
|
-
-1,
|
|
955
|
-
-1,
|
|
956
|
-
-1,
|
|
957
|
-
-1,
|
|
958
|
-
-1,
|
|
959
|
-
-1,
|
|
960
|
-
-1,
|
|
961
|
-
-1,
|
|
962
|
-
-1,
|
|
963
|
-
-1,
|
|
964
|
-
-1,
|
|
965
|
-
-1,
|
|
966
|
-
-1,
|
|
967
|
-
-1,
|
|
968
|
-
-1,
|
|
969
|
-
-1,
|
|
970
|
-
-1,
|
|
971
|
-
-1,
|
|
972
|
-
-1,
|
|
973
|
-
-1,
|
|
974
|
-
-1,
|
|
975
|
-
-1,
|
|
976
|
-
-1,
|
|
977
|
-
-1,
|
|
978
|
-
-1,
|
|
979
|
-
-1,
|
|
980
|
-
-1,
|
|
981
|
-
-1,
|
|
982
|
-
-1,
|
|
983
|
-
-1,
|
|
984
|
-
-1
|
|
985
|
-
]);
|
|
986
|
-
/**
|
|
987
|
-
* A safe fast alternative to decodeURIComponent
|
|
988
|
-
*/
|
|
989
|
-
function unescapeBuffer(s, decodeSpaces = false) {
|
|
990
|
-
const out = new Buffer(s.length);
|
|
991
|
-
let index = 0;
|
|
992
|
-
let outIndex = 0;
|
|
993
|
-
let currentChar;
|
|
994
|
-
let nextChar;
|
|
995
|
-
let hexHigh;
|
|
996
|
-
let hexLow;
|
|
997
|
-
const maxLength = s.length - 2;
|
|
998
|
-
let hasHex = false;
|
|
999
|
-
while (index < s.length) {
|
|
1000
|
-
currentChar = s.charCodeAt(index);
|
|
1001
|
-
if (currentChar === 43 && decodeSpaces) {
|
|
1002
|
-
out[outIndex++] = 32;
|
|
1003
|
-
index++;
|
|
1004
|
-
continue;
|
|
1005
|
-
}
|
|
1006
|
-
if (currentChar === 37 && index < maxLength) {
|
|
1007
|
-
currentChar = s.charCodeAt(++index);
|
|
1008
|
-
hexHigh = unhexTable[currentChar];
|
|
1009
|
-
if (!(hexHigh >= 0)) {
|
|
1010
|
-
out[outIndex++] = 37;
|
|
1011
|
-
continue;
|
|
1012
|
-
} else {
|
|
1013
|
-
nextChar = s.charCodeAt(++index);
|
|
1014
|
-
hexLow = unhexTable[nextChar];
|
|
1015
|
-
if (!(hexLow >= 0)) {
|
|
1016
|
-
out[outIndex++] = 37;
|
|
1017
|
-
index--;
|
|
1018
|
-
} else {
|
|
1019
|
-
hasHex = true;
|
|
1020
|
-
currentChar = hexHigh * 16 + hexLow;
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
out[outIndex++] = currentChar;
|
|
1025
|
-
index++;
|
|
1026
|
-
}
|
|
1027
|
-
return hasHex ? out.slice(0, outIndex) : out;
|
|
1028
|
-
}
|
|
1029
|
-
function qsUnescape(s) {
|
|
1030
|
-
try {
|
|
1031
|
-
return decodeURIComponent(s);
|
|
1032
|
-
} catch {
|
|
1033
|
-
return unescapeBuffer(s).toString();
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
/**
|
|
1037
|
-
* Performs decoding of URL percent-encoded characters on the given `str`.
|
|
1038
|
-
* Used by `querystring.parse()` and is generally not expected to be used directly.
|
|
1039
|
-
* It is exported primarily to allow application code to provide a replacement decoding implementation if necessary by assigning `querystring.unescape` to an alternative function.
|
|
1040
|
-
* @legacy
|
|
1041
|
-
* @see Tested in `test-querystring-escape.js`
|
|
1042
|
-
*/
|
|
1043
|
-
const unescape = qsUnescape;
|
|
1044
|
-
var src_default = {
|
|
1045
|
-
parse,
|
|
1046
|
-
stringify,
|
|
1047
|
-
decode,
|
|
1048
|
-
encode,
|
|
1049
|
-
unescape,
|
|
1050
|
-
escape,
|
|
1051
|
-
unescapeBuffer
|
|
1052
|
-
};
|
|
1053
|
-
|
|
1054
|
-
//#endregion
|
|
1055
|
-
export { ERR_INVALID_URI, decode, src_default as default, encode, escape, parse, stringify, unescape, unescapeBuffer };
|
|
1
|
+
import{NodeURIError as e}from"./error.js";import{Buffer as t}from"node:buffer";const n=Array(256);for(let e=0;e<256;++e)n[e]=`%`+((e<16?`0`:``)+e.toString(16)).toUpperCase();function r(e,t,n){let r=e.length;if(r===0)return``;let a=``,o=0;for(let s=0;s<r;s++){let c=e.charCodeAt(s);if(c<128){if(t[c]===1)continue;o<s&&(a+=e.slice(o,s)),o=s+1,a+=n[c];continue}if(o<s&&(a+=e.slice(o,s)),c<2048){o=s+1,a+=n[192|c>>6]+n[128|c&63];continue}if(c<55296||c>=57344){o=s+1,a+=n[224|c>>12]+n[128|c>>6&63]+n[128|c&63];continue}if(++s,s>=r)throw new i;let l=e.charCodeAt(s)&1023;o=s+1,c=65536+((c&1023)<<10|l),a+=n[240|c>>18]+n[128|c>>12&63]+n[128|c>>6&63]+n[128|c&63]}return o===0?e:o<r?a+e.slice(o):a}var i=class extends e{constructor(){super(`ERR_INVALID_URI`,`URI malformed`)}};const a=f,o=_;function s(e){return typeof e!=`string`&&(typeof e==`object`?e=String(e):e+=``),r(e,p,n)}const c=s,l=new Int8Array([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,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,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,1,1,1,1,1,1,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,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]);function u(e){let t=Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}function d(e,t,n,r,i,a){if(t.length>0&&r)try{t=a(t)}catch{}if(n.length>0&&i)try{n=a(n)}catch{}if(e[t]===void 0)e[t]=n;else{let r=e[t];r.pop?r[r.length]=n:e[t]=[r,n]}}function f(e,t=`&`,n=`=`,{decodeURIComponent:r=x,maxKeys:i=1e3}={}){let a=Object.create(null);if(typeof e!=`string`||e.length===0)return a;let o=t?u(String(t)):[38],s=n?u(String(n)):[61],c=o.length,f=s.length,p=1e3;typeof i==`number`&&(p=i>0?i:-1);let m=x;r&&(m=r);let h=m!==x,g=0,_=0,v=0,y=``,b=``,S=h,C=h,w=h?`%20`:` `,T=0;for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n===o[_]){if(++_===c){let n=t-_+1;if(v<f){if(g<n)y+=e.slice(g,n);else if(y.length===0){if(--p===0)return a;g=t+1,_=v=0;continue}}else g<n&&(b+=e.slice(g,n));if(d(a,y,b,S,C,m),--p===0)return a;y=b=``,T=0,g=t+1,_=v=0}}else{if(_=0,v<f){if(n===s[v]){if(++v===f){let n=t-v+1;g<n&&(y+=e.slice(g,n)),T=0,g=t+1}continue}else if(v=0,!S){if(n===37){T=1;continue}else if(T>0)if(l[n]===1){++T===3&&(S=!0);continue}else T=0}if(n===43){g<t&&(y+=e.slice(g,t)),y+=w,g=t+1;continue}}n===43?(g<t&&(b+=e.slice(g,t)),b+=w,g=t+1):C||(n===37?T=1:T>0&&(l[n]===1?++T===3&&(C=!0):T=0))}}if(g<e.length)v<f?y+=e.slice(g):_<c&&(b+=e.slice(g));else if(v===0&&y.length===0)return a;return d(a,y,b,S,C,m),a}const p=new Int8Array([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,1,0,0,0,0,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0]);function m(e){return typeof e==`string`?e:typeof e==`number`&&isFinite(e)||typeof e==`bigint`?``+e:typeof e==`boolean`?e?`true`:`false`:``}function h(e,t){return t(m(e))}function g(e,t){return typeof e==`string`?e.length?t(e):``:typeof e==`number`&&isFinite(e)?Math.abs(e)<1e21?``+e:t(``+e):typeof e==`bigint`?``+e:typeof e==`boolean`?e?`true`:`false`:``}function _(e,t,n,r){t||=`&`,n||=`=`;let i=r?r.encodeURIComponent:s,a=r?h:g;if(typeof e==`object`&&e){let r=Object.keys(e),o=r.length,s=``;for(let c=0;c<o;++c){let o=r[c],l=e[o],u=a(o,i);if(u+=n,Array.isArray(l)){let e=l.length;if(e===0)continue;s&&(s+=t);for(let n=0;n<e;++n)n&&(s+=t),s+=u,s+=a(l[n],i)}else s&&(s+=t),s+=u,s+=a(l,i)}return s}return``}const v=new Int8Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);function y(e,n=!1){let r=new t(e.length),i=0,a=0,o,s,c,l,u=e.length-2,d=!1;for(;i<e.length;){if(o=e.charCodeAt(i),o===43&&n){r[a++]=32,i++;continue}if(o===37&&i<u)if(o=e.charCodeAt(++i),c=v[o],c>=0)s=e.charCodeAt(++i),l=v[s],l>=0?(d=!0,o=c*16+l):(r[a++]=37,i--);else{r[a++]=37;continue}r[a++]=o,i++}return d?r.slice(0,a):r}function b(e){try{return decodeURIComponent(e)}catch{return y(e).toString()}}const x=b;var S={parse:f,stringify:_,decode:a,encode:o,unescape:x,escape:c,unescapeBuffer:y};export{i as ERR_INVALID_URI,a as decode,S as default,o as encode,c as escape,f as parse,_ as stringify,x as unescape,y as unescapeBuffer};
|