superagent 8.1.1 → 9.0.0
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/README.md +1 -1
- package/dist/superagent.js +364 -124
- package/dist/superagent.min.js +1 -1
- package/lib/agent-base.js +12 -22
- package/lib/client.js +27 -27
- package/lib/node/agent.js +79 -89
- package/lib/node/http2wrapper.js +18 -21
- package/lib/node/index.js +82 -63
- package/lib/node/parsers/image.js +1 -1
- package/lib/node/parsers/index.js +1 -1
- package/lib/node/parsers/json.js +1 -1
- package/lib/node/parsers/text.js +1 -1
- package/lib/node/parsers/urlencoded.js +1 -1
- package/lib/node/response.js +16 -7
- package/lib/node/unzip.js +4 -3
- package/lib/request-base.js +6 -6
- package/lib/response-base.js +1 -1
- package/lib/utils.js +11 -32
- package/package.json +4 -4
package/dist/superagent.js
CHANGED
|
@@ -14,37 +14,24 @@ module.exports = function callBoundIntrinsic(name, allowMissing) {
|
|
|
14
14
|
return intrinsic;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
},{"./":3,"get-intrinsic":
|
|
17
|
+
},{"./":3,"get-intrinsic":17}],3:[function(require,module,exports){
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
20
|
var bind = require('function-bind');
|
|
21
21
|
var GetIntrinsic = require('get-intrinsic');
|
|
22
|
+
var setFunctionLength = require('set-function-length');
|
|
23
|
+
var $TypeError = require('es-errors/type');
|
|
22
24
|
var $apply = GetIntrinsic('%Function.prototype.apply%');
|
|
23
25
|
var $call = GetIntrinsic('%Function.prototype.call%');
|
|
24
26
|
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
|
|
25
|
-
var $
|
|
26
|
-
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
|
27
|
+
var $defineProperty = require('es-define-property');
|
|
27
28
|
var $max = GetIntrinsic('%Math.max%');
|
|
28
|
-
if ($defineProperty) {
|
|
29
|
-
try {
|
|
30
|
-
$defineProperty({}, 'a', {
|
|
31
|
-
value: 1
|
|
32
|
-
});
|
|
33
|
-
} catch (e) {
|
|
34
|
-
$defineProperty = null;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
29
|
module.exports = function callBind(originalFunction) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var desc = $gOPD(func, 'length');
|
|
41
|
-
if (desc.configurable) {
|
|
42
|
-
$defineProperty(func, 'length', {
|
|
43
|
-
value: 1 + $max(0, originalFunction.length - (arguments.length - 1))
|
|
44
|
-
});
|
|
45
|
-
}
|
|
30
|
+
if (typeof originalFunction !== 'function') {
|
|
31
|
+
throw new $TypeError('a function is required');
|
|
46
32
|
}
|
|
47
|
-
|
|
33
|
+
var func = $reflectApply(bind, $call, arguments);
|
|
34
|
+
return setFunctionLength(func, 1 + $max(0, originalFunction.length - (arguments.length - 1)), true);
|
|
48
35
|
};
|
|
49
36
|
var applyBind = function applyBind() {
|
|
50
37
|
return $reflectApply(bind, $apply, arguments);
|
|
@@ -57,7 +44,7 @@ if ($defineProperty) {
|
|
|
57
44
|
module.exports.apply = applyBind;
|
|
58
45
|
}
|
|
59
46
|
|
|
60
|
-
},{"function-bind":
|
|
47
|
+
},{"es-define-property":6,"es-errors/type":12,"function-bind":16,"get-intrinsic":17,"set-function-length":31}],4:[function(require,module,exports){
|
|
61
48
|
if (typeof module !== 'undefined') {
|
|
62
49
|
module.exports = Emitter;
|
|
63
50
|
}
|
|
@@ -134,6 +121,95 @@ Emitter.prototype.hasListeners = function (event) {
|
|
|
134
121
|
};
|
|
135
122
|
|
|
136
123
|
},{}],5:[function(require,module,exports){
|
|
124
|
+
'use strict';
|
|
125
|
+
|
|
126
|
+
var $defineProperty = require('es-define-property');
|
|
127
|
+
var $SyntaxError = require('es-errors/syntax');
|
|
128
|
+
var $TypeError = require('es-errors/type');
|
|
129
|
+
var gopd = require('gopd');
|
|
130
|
+
module.exports = function defineDataProperty(obj, property, value) {
|
|
131
|
+
if (!obj || typeof obj !== 'object' && typeof obj !== 'function') {
|
|
132
|
+
throw new $TypeError('`obj` must be an object or a function`');
|
|
133
|
+
}
|
|
134
|
+
if (typeof property !== 'string' && typeof property !== 'symbol') {
|
|
135
|
+
throw new $TypeError('`property` must be a string or a symbol`');
|
|
136
|
+
}
|
|
137
|
+
if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
|
|
138
|
+
throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');
|
|
139
|
+
}
|
|
140
|
+
if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
|
|
141
|
+
throw new $TypeError('`nonWritable`, if provided, must be a boolean or null');
|
|
142
|
+
}
|
|
143
|
+
if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
|
|
144
|
+
throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');
|
|
145
|
+
}
|
|
146
|
+
if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
|
|
147
|
+
throw new $TypeError('`loose`, if provided, must be a boolean');
|
|
148
|
+
}
|
|
149
|
+
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
|
150
|
+
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
|
151
|
+
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
|
152
|
+
var loose = arguments.length > 6 ? arguments[6] : false;
|
|
153
|
+
var desc = !!gopd && gopd(obj, property);
|
|
154
|
+
if ($defineProperty) {
|
|
155
|
+
$defineProperty(obj, property, {
|
|
156
|
+
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
|
157
|
+
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
|
158
|
+
value: value,
|
|
159
|
+
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
|
160
|
+
});
|
|
161
|
+
} else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) {
|
|
162
|
+
obj[property] = value;
|
|
163
|
+
} else {
|
|
164
|
+
throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
},{"es-define-property":6,"es-errors/syntax":11,"es-errors/type":12,"gopd":18}],6:[function(require,module,exports){
|
|
169
|
+
'use strict';
|
|
170
|
+
|
|
171
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
172
|
+
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;
|
|
173
|
+
if ($defineProperty) {
|
|
174
|
+
try {
|
|
175
|
+
$defineProperty({}, 'a', {
|
|
176
|
+
value: 1
|
|
177
|
+
});
|
|
178
|
+
} catch (e) {
|
|
179
|
+
$defineProperty = false;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
module.exports = $defineProperty;
|
|
183
|
+
|
|
184
|
+
},{"get-intrinsic":17}],7:[function(require,module,exports){
|
|
185
|
+
'use strict';
|
|
186
|
+
module.exports = EvalError;
|
|
187
|
+
|
|
188
|
+
},{}],8:[function(require,module,exports){
|
|
189
|
+
'use strict';
|
|
190
|
+
module.exports = Error;
|
|
191
|
+
|
|
192
|
+
},{}],9:[function(require,module,exports){
|
|
193
|
+
'use strict';
|
|
194
|
+
module.exports = RangeError;
|
|
195
|
+
|
|
196
|
+
},{}],10:[function(require,module,exports){
|
|
197
|
+
'use strict';
|
|
198
|
+
module.exports = ReferenceError;
|
|
199
|
+
|
|
200
|
+
},{}],11:[function(require,module,exports){
|
|
201
|
+
'use strict';
|
|
202
|
+
module.exports = SyntaxError;
|
|
203
|
+
|
|
204
|
+
},{}],12:[function(require,module,exports){
|
|
205
|
+
'use strict';
|
|
206
|
+
module.exports = TypeError;
|
|
207
|
+
|
|
208
|
+
},{}],13:[function(require,module,exports){
|
|
209
|
+
'use strict';
|
|
210
|
+
module.exports = URIError;
|
|
211
|
+
|
|
212
|
+
},{}],14:[function(require,module,exports){
|
|
137
213
|
module.exports = stringify;
|
|
138
214
|
stringify.default = stringify;
|
|
139
215
|
stringify.stable = deterministicStringify;
|
|
@@ -325,36 +401,62 @@ function replaceGetterValues(replacer) {
|
|
|
325
401
|
};
|
|
326
402
|
}
|
|
327
403
|
|
|
328
|
-
},{}],
|
|
404
|
+
},{}],15:[function(require,module,exports){
|
|
329
405
|
'use strict';
|
|
330
406
|
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
331
|
-
var slice = Array.prototype.slice;
|
|
332
407
|
var toStr = Object.prototype.toString;
|
|
408
|
+
var max = Math.max;
|
|
333
409
|
var funcType = '[object Function]';
|
|
410
|
+
var concatty = function concatty(a, b) {
|
|
411
|
+
var arr = [];
|
|
412
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
413
|
+
arr[i] = a[i];
|
|
414
|
+
}
|
|
415
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
416
|
+
arr[j + a.length] = b[j];
|
|
417
|
+
}
|
|
418
|
+
return arr;
|
|
419
|
+
};
|
|
420
|
+
var slicy = function slicy(arrLike, offset) {
|
|
421
|
+
var arr = [];
|
|
422
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
423
|
+
arr[j] = arrLike[i];
|
|
424
|
+
}
|
|
425
|
+
return arr;
|
|
426
|
+
};
|
|
427
|
+
var joiny = function (arr, joiner) {
|
|
428
|
+
var str = '';
|
|
429
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
430
|
+
str += arr[i];
|
|
431
|
+
if (i + 1 < arr.length) {
|
|
432
|
+
str += joiner;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
return str;
|
|
436
|
+
};
|
|
334
437
|
module.exports = function bind(that) {
|
|
335
438
|
var target = this;
|
|
336
|
-
if (typeof target !== 'function' || toStr.
|
|
439
|
+
if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
|
|
337
440
|
throw new TypeError(ERROR_MESSAGE + target);
|
|
338
441
|
}
|
|
339
|
-
var args =
|
|
442
|
+
var args = slicy(arguments, 1);
|
|
340
443
|
var bound;
|
|
341
444
|
var binder = function () {
|
|
342
445
|
if (this instanceof bound) {
|
|
343
|
-
var result = target.apply(this, args
|
|
446
|
+
var result = target.apply(this, concatty(args, arguments));
|
|
344
447
|
if (Object(result) === result) {
|
|
345
448
|
return result;
|
|
346
449
|
}
|
|
347
450
|
return this;
|
|
348
|
-
} else {
|
|
349
|
-
return target.apply(that, args.concat(slice.call(arguments)));
|
|
350
451
|
}
|
|
452
|
+
return target.apply(that, concatty(args, arguments));
|
|
351
453
|
};
|
|
352
|
-
var boundLength =
|
|
454
|
+
var boundLength = max(0, target.length - args.length);
|
|
353
455
|
var boundArgs = [];
|
|
354
456
|
for (var i = 0; i < boundLength; i++) {
|
|
355
|
-
boundArgs
|
|
457
|
+
boundArgs[i] = '$' + i;
|
|
356
458
|
}
|
|
357
|
-
bound = Function('binder', 'return function (' + boundArgs
|
|
459
|
+
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
358
460
|
if (target.prototype) {
|
|
359
461
|
var Empty = function Empty() {};
|
|
360
462
|
Empty.prototype = target.prototype;
|
|
@@ -364,19 +466,24 @@ module.exports = function bind(that) {
|
|
|
364
466
|
return bound;
|
|
365
467
|
};
|
|
366
468
|
|
|
367
|
-
},{}],
|
|
469
|
+
},{}],16:[function(require,module,exports){
|
|
368
470
|
'use strict';
|
|
369
471
|
|
|
370
472
|
var implementation = require('./implementation');
|
|
371
473
|
module.exports = Function.prototype.bind || implementation;
|
|
372
474
|
|
|
373
|
-
},{"./implementation":
|
|
475
|
+
},{"./implementation":15}],17:[function(require,module,exports){
|
|
374
476
|
'use strict';
|
|
375
477
|
|
|
376
478
|
var undefined;
|
|
377
|
-
var $
|
|
479
|
+
var $Error = require('es-errors');
|
|
480
|
+
var $EvalError = require('es-errors/eval');
|
|
481
|
+
var $RangeError = require('es-errors/range');
|
|
482
|
+
var $ReferenceError = require('es-errors/ref');
|
|
483
|
+
var $SyntaxError = require('es-errors/syntax');
|
|
484
|
+
var $TypeError = require('es-errors/type');
|
|
485
|
+
var $URIError = require('es-errors/uri');
|
|
378
486
|
var $Function = Function;
|
|
379
|
-
var $TypeError = TypeError;
|
|
380
487
|
var getEvalledConstructor = function (expressionSyntax) {
|
|
381
488
|
try {
|
|
382
489
|
return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
|
|
@@ -413,6 +520,7 @@ var getProto = Object.getPrototypeOf || (hasProto ? function (x) {
|
|
|
413
520
|
var needsEval = {};
|
|
414
521
|
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
|
|
415
522
|
var INTRINSICS = {
|
|
523
|
+
__proto__: null,
|
|
416
524
|
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
|
|
417
525
|
'%Array%': Array,
|
|
418
526
|
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
|
|
@@ -433,9 +541,9 @@ var INTRINSICS = {
|
|
|
433
541
|
'%decodeURIComponent%': decodeURIComponent,
|
|
434
542
|
'%encodeURI%': encodeURI,
|
|
435
543
|
'%encodeURIComponent%': encodeURIComponent,
|
|
436
|
-
'%Error%': Error,
|
|
544
|
+
'%Error%': $Error,
|
|
437
545
|
'%eval%': eval,
|
|
438
|
-
'%EvalError%': EvalError,
|
|
546
|
+
'%EvalError%': $EvalError,
|
|
439
547
|
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
|
|
440
548
|
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
|
|
441
549
|
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
|
|
@@ -457,8 +565,8 @@ var INTRINSICS = {
|
|
|
457
565
|
'%parseInt%': parseInt,
|
|
458
566
|
'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
|
|
459
567
|
'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
|
|
460
|
-
'%RangeError%': RangeError,
|
|
461
|
-
'%ReferenceError%': ReferenceError,
|
|
568
|
+
'%RangeError%': $RangeError,
|
|
569
|
+
'%ReferenceError%': $ReferenceError,
|
|
462
570
|
'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
|
|
463
571
|
'%RegExp%': RegExp,
|
|
464
572
|
'%Set%': typeof Set === 'undefined' ? undefined : Set,
|
|
@@ -475,7 +583,7 @@ var INTRINSICS = {
|
|
|
475
583
|
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
|
|
476
584
|
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
|
|
477
585
|
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
|
|
478
|
-
'%URIError%': URIError,
|
|
586
|
+
'%URIError%': $URIError,
|
|
479
587
|
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
|
|
480
588
|
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
|
|
481
589
|
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
|
|
@@ -511,6 +619,7 @@ var doEval = function doEval(name) {
|
|
|
511
619
|
return value;
|
|
512
620
|
};
|
|
513
621
|
var LEGACY_ALIASES = {
|
|
622
|
+
__proto__: null,
|
|
514
623
|
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
|
515
624
|
'%ArrayPrototype%': ['Array', 'prototype'],
|
|
516
625
|
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
|
@@ -564,7 +673,7 @@ var LEGACY_ALIASES = {
|
|
|
564
673
|
'%WeakSetPrototype%': ['WeakSet', 'prototype']
|
|
565
674
|
};
|
|
566
675
|
var bind = require('function-bind');
|
|
567
|
-
var hasOwn = require('
|
|
676
|
+
var hasOwn = require('hasown');
|
|
568
677
|
var $concat = bind.call(Function.call, Array.prototype.concat);
|
|
569
678
|
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
|
|
570
679
|
var $replace = bind.call(Function.call, String.prototype.replace);
|
|
@@ -671,22 +780,56 @@ module.exports = function GetIntrinsic(name, allowMissing) {
|
|
|
671
780
|
return value;
|
|
672
781
|
};
|
|
673
782
|
|
|
674
|
-
},{"
|
|
783
|
+
},{"es-errors":8,"es-errors/eval":7,"es-errors/range":9,"es-errors/ref":10,"es-errors/syntax":11,"es-errors/type":12,"es-errors/uri":13,"function-bind":16,"has-proto":20,"has-symbols":21,"hasown":23}],18:[function(require,module,exports){
|
|
784
|
+
'use strict';
|
|
785
|
+
|
|
786
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
787
|
+
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
788
|
+
if ($gOPD) {
|
|
789
|
+
try {
|
|
790
|
+
$gOPD([], 'length');
|
|
791
|
+
} catch (e) {
|
|
792
|
+
$gOPD = null;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
module.exports = $gOPD;
|
|
796
|
+
|
|
797
|
+
},{"get-intrinsic":17}],19:[function(require,module,exports){
|
|
798
|
+
'use strict';
|
|
799
|
+
|
|
800
|
+
var $defineProperty = require('es-define-property');
|
|
801
|
+
var hasPropertyDescriptors = function hasPropertyDescriptors() {
|
|
802
|
+
return !!$defineProperty;
|
|
803
|
+
};
|
|
804
|
+
hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
|
|
805
|
+
if (!$defineProperty) {
|
|
806
|
+
return null;
|
|
807
|
+
}
|
|
808
|
+
try {
|
|
809
|
+
return $defineProperty([], 'length', {
|
|
810
|
+
value: 1
|
|
811
|
+
}).length !== 1;
|
|
812
|
+
} catch (e) {
|
|
813
|
+
return true;
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
module.exports = hasPropertyDescriptors;
|
|
817
|
+
|
|
818
|
+
},{"es-define-property":6}],20:[function(require,module,exports){
|
|
675
819
|
'use strict';
|
|
676
820
|
|
|
677
821
|
var test = {
|
|
822
|
+
__proto__: null,
|
|
678
823
|
foo: {}
|
|
679
824
|
};
|
|
680
825
|
var $Object = Object;
|
|
681
826
|
module.exports = function hasProto() {
|
|
682
827
|
return {
|
|
683
828
|
__proto__: test
|
|
684
|
-
}.foo === test.foo && !(
|
|
685
|
-
__proto__: null
|
|
686
|
-
} instanceof $Object);
|
|
829
|
+
}.foo === test.foo && !(test instanceof $Object);
|
|
687
830
|
};
|
|
688
831
|
|
|
689
|
-
},{}],
|
|
832
|
+
},{}],21:[function(require,module,exports){
|
|
690
833
|
'use strict';
|
|
691
834
|
|
|
692
835
|
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
|
@@ -707,7 +850,7 @@ module.exports = function hasNativeSymbols() {
|
|
|
707
850
|
return hasSymbolSham();
|
|
708
851
|
};
|
|
709
852
|
|
|
710
|
-
},{"./shams":
|
|
853
|
+
},{"./shams":22}],22:[function(require,module,exports){
|
|
711
854
|
'use strict';
|
|
712
855
|
module.exports = function hasSymbols() {
|
|
713
856
|
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') {
|
|
@@ -755,13 +898,16 @@ module.exports = function hasSymbols() {
|
|
|
755
898
|
return true;
|
|
756
899
|
};
|
|
757
900
|
|
|
758
|
-
},{}],
|
|
901
|
+
},{}],23:[function(require,module,exports){
|
|
759
902
|
'use strict';
|
|
760
903
|
|
|
904
|
+
var call = Function.prototype.call;
|
|
905
|
+
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
761
906
|
var bind = require('function-bind');
|
|
762
|
-
module.exports = bind.call(
|
|
907
|
+
module.exports = bind.call(call, $hasOwn);
|
|
763
908
|
|
|
764
|
-
},{"function-bind":
|
|
909
|
+
},{"function-bind":16}],24:[function(require,module,exports){
|
|
910
|
+
(function (global){(function (){
|
|
765
911
|
var hasMap = typeof Map === 'function' && Map.prototype;
|
|
766
912
|
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
|
|
767
913
|
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
|
|
@@ -977,6 +1123,12 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
977
1123
|
if (isString(obj)) {
|
|
978
1124
|
return markBoxed(inspect(String(obj)));
|
|
979
1125
|
}
|
|
1126
|
+
if (typeof window !== 'undefined' && obj === window) {
|
|
1127
|
+
return '{ [object Window] }';
|
|
1128
|
+
}
|
|
1129
|
+
if (obj === global) {
|
|
1130
|
+
return '{ [object globalThis] }';
|
|
1131
|
+
}
|
|
980
1132
|
if (!isDate(obj) && !isRegExp(obj)) {
|
|
981
1133
|
var ys = arrObjKeys(obj, inspect);
|
|
982
1134
|
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
@@ -1261,7 +1413,8 @@ function arrObjKeys(obj, inspect) {
|
|
|
1261
1413
|
return xs;
|
|
1262
1414
|
}
|
|
1263
1415
|
|
|
1264
|
-
},
|
|
1416
|
+
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
1417
|
+
},{"./util.inspect":1}],25:[function(require,module,exports){
|
|
1265
1418
|
var process = module.exports = {};
|
|
1266
1419
|
var cachedSetTimeout;
|
|
1267
1420
|
var cachedClearTimeout;
|
|
@@ -1418,7 +1571,7 @@ process.umask = function () {
|
|
|
1418
1571
|
return 0;
|
|
1419
1572
|
};
|
|
1420
1573
|
|
|
1421
|
-
},{}],
|
|
1574
|
+
},{}],26:[function(require,module,exports){
|
|
1422
1575
|
'use strict';
|
|
1423
1576
|
|
|
1424
1577
|
var replace = String.prototype.replace;
|
|
@@ -1441,7 +1594,7 @@ module.exports = {
|
|
|
1441
1594
|
RFC3986: Format.RFC3986
|
|
1442
1595
|
};
|
|
1443
1596
|
|
|
1444
|
-
},{}],
|
|
1597
|
+
},{}],27:[function(require,module,exports){
|
|
1445
1598
|
'use strict';
|
|
1446
1599
|
|
|
1447
1600
|
var stringify = require('./stringify');
|
|
@@ -1453,7 +1606,7 @@ module.exports = {
|
|
|
1453
1606
|
stringify: stringify
|
|
1454
1607
|
};
|
|
1455
1608
|
|
|
1456
|
-
},{"./formats":
|
|
1609
|
+
},{"./formats":26,"./parse":28,"./stringify":29}],28:[function(require,module,exports){
|
|
1457
1610
|
'use strict';
|
|
1458
1611
|
|
|
1459
1612
|
var utils = require('./utils');
|
|
@@ -1461,15 +1614,18 @@ var has = Object.prototype.hasOwnProperty;
|
|
|
1461
1614
|
var isArray = Array.isArray;
|
|
1462
1615
|
var defaults = {
|
|
1463
1616
|
allowDots: false,
|
|
1617
|
+
allowEmptyArrays: false,
|
|
1464
1618
|
allowPrototypes: false,
|
|
1465
1619
|
allowSparse: false,
|
|
1466
1620
|
arrayLimit: 20,
|
|
1467
1621
|
charset: 'utf-8',
|
|
1468
1622
|
charsetSentinel: false,
|
|
1469
1623
|
comma: false,
|
|
1624
|
+
decodeDotInKeys: false,
|
|
1470
1625
|
decoder: utils.decode,
|
|
1471
1626
|
delimiter: '&',
|
|
1472
1627
|
depth: 5,
|
|
1628
|
+
duplicates: 'combine',
|
|
1473
1629
|
ignoreQueryPrefix: false,
|
|
1474
1630
|
interpretNumericEntities: false,
|
|
1475
1631
|
parameterLimit: 1000,
|
|
@@ -1536,9 +1692,10 @@ var parseValues = function parseQueryStringValues(str, options) {
|
|
|
1536
1692
|
if (part.indexOf('[]=') > -1) {
|
|
1537
1693
|
val = isArray(val) ? [val] : val;
|
|
1538
1694
|
}
|
|
1539
|
-
|
|
1695
|
+
var existing = has.call(obj, key);
|
|
1696
|
+
if (existing && options.duplicates === 'combine') {
|
|
1540
1697
|
obj[key] = utils.combine(obj[key], val);
|
|
1541
|
-
} else {
|
|
1698
|
+
} else if (!existing || options.duplicates === 'last') {
|
|
1542
1699
|
obj[key] = val;
|
|
1543
1700
|
}
|
|
1544
1701
|
}
|
|
@@ -1550,20 +1707,21 @@ var parseObject = function (chain, val, options, valuesParsed) {
|
|
|
1550
1707
|
var obj;
|
|
1551
1708
|
var root = chain[i];
|
|
1552
1709
|
if (root === '[]' && options.parseArrays) {
|
|
1553
|
-
obj = [].concat(leaf);
|
|
1710
|
+
obj = options.allowEmptyArrays && leaf === '' ? [] : [].concat(leaf);
|
|
1554
1711
|
} else {
|
|
1555
1712
|
obj = options.plainObjects ? Object.create(null) : {};
|
|
1556
1713
|
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
1557
|
-
var
|
|
1558
|
-
|
|
1714
|
+
var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
|
|
1715
|
+
var index = parseInt(decodedRoot, 10);
|
|
1716
|
+
if (!options.parseArrays && decodedRoot === '') {
|
|
1559
1717
|
obj = {
|
|
1560
1718
|
0: leaf
|
|
1561
1719
|
};
|
|
1562
|
-
} else if (!isNaN(index) && root !==
|
|
1720
|
+
} else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays && index <= options.arrayLimit) {
|
|
1563
1721
|
obj = [];
|
|
1564
1722
|
obj[index] = leaf;
|
|
1565
|
-
} else if (
|
|
1566
|
-
obj[
|
|
1723
|
+
} else if (decodedRoot !== '__proto__') {
|
|
1724
|
+
obj[decodedRoot] = leaf;
|
|
1567
1725
|
}
|
|
1568
1726
|
}
|
|
1569
1727
|
leaf = obj;
|
|
@@ -1607,24 +1765,38 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
|
1607
1765
|
if (!opts) {
|
|
1608
1766
|
return defaults;
|
|
1609
1767
|
}
|
|
1610
|
-
if (
|
|
1768
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
1769
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
1770
|
+
}
|
|
1771
|
+
if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
|
|
1772
|
+
throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
1773
|
+
}
|
|
1774
|
+
if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
|
|
1611
1775
|
throw new TypeError('Decoder has to be a function.');
|
|
1612
1776
|
}
|
|
1613
1777
|
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
1614
1778
|
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
1615
1779
|
}
|
|
1616
1780
|
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
|
1781
|
+
var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
|
|
1782
|
+
if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
|
|
1783
|
+
throw new TypeError('The duplicates option must be either combine, first, or last');
|
|
1784
|
+
}
|
|
1785
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
1617
1786
|
return {
|
|
1618
|
-
allowDots:
|
|
1787
|
+
allowDots: allowDots,
|
|
1788
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
1619
1789
|
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
1620
1790
|
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
|
|
1621
1791
|
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
|
1622
1792
|
charset: charset,
|
|
1623
1793
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
1624
1794
|
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
|
1795
|
+
decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
|
|
1625
1796
|
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
|
1626
1797
|
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
1627
1798
|
depth: typeof opts.depth === 'number' || opts.depth === false ? +opts.depth : defaults.depth,
|
|
1799
|
+
duplicates: duplicates,
|
|
1628
1800
|
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
1629
1801
|
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
1630
1802
|
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
|
@@ -1652,7 +1824,7 @@ module.exports = function (str, opts) {
|
|
|
1652
1824
|
return utils.compact(obj);
|
|
1653
1825
|
};
|
|
1654
1826
|
|
|
1655
|
-
},{"./utils":
|
|
1827
|
+
},{"./utils":30}],29:[function(require,module,exports){
|
|
1656
1828
|
'use strict';
|
|
1657
1829
|
|
|
1658
1830
|
var getSideChannel = require('side-channel');
|
|
@@ -1681,10 +1853,13 @@ var defaultFormat = formats['default'];
|
|
|
1681
1853
|
var defaults = {
|
|
1682
1854
|
addQueryPrefix: false,
|
|
1683
1855
|
allowDots: false,
|
|
1856
|
+
allowEmptyArrays: false,
|
|
1857
|
+
arrayFormat: 'indices',
|
|
1684
1858
|
charset: 'utf-8',
|
|
1685
1859
|
charsetSentinel: false,
|
|
1686
1860
|
delimiter: '&',
|
|
1687
1861
|
encode: true,
|
|
1862
|
+
encodeDotInKeys: false,
|
|
1688
1863
|
encoder: utils.encode,
|
|
1689
1864
|
encodeValuesOnly: false,
|
|
1690
1865
|
format: defaultFormat,
|
|
@@ -1700,7 +1875,7 @@ var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|
|
|
1700
1875
|
return typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean' || typeof v === 'symbol' || typeof v === 'bigint';
|
|
1701
1876
|
};
|
|
1702
1877
|
var sentinel = {};
|
|
1703
|
-
var stringify = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) {
|
|
1878
|
+
var stringify = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) {
|
|
1704
1879
|
var obj = object;
|
|
1705
1880
|
var tmpSc = sideChannel;
|
|
1706
1881
|
var step = 0;
|
|
@@ -1762,18 +1937,23 @@ var stringify = function stringify(object, prefix, generateArrayPrefix, commaRou
|
|
|
1762
1937
|
var keys = Object.keys(obj);
|
|
1763
1938
|
objKeys = sort ? keys.sort(sort) : keys;
|
|
1764
1939
|
}
|
|
1765
|
-
var
|
|
1940
|
+
var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix;
|
|
1941
|
+
var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
|
|
1942
|
+
if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
|
|
1943
|
+
return adjustedPrefix + '[]';
|
|
1944
|
+
}
|
|
1766
1945
|
for (var j = 0; j < objKeys.length; ++j) {
|
|
1767
1946
|
var key = objKeys[j];
|
|
1768
1947
|
var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
|
|
1769
1948
|
if (skipNulls && value === null) {
|
|
1770
1949
|
continue;
|
|
1771
1950
|
}
|
|
1772
|
-
var
|
|
1951
|
+
var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key;
|
|
1952
|
+
var keyPrefix = isArray(obj) ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
|
|
1773
1953
|
sideChannel.set(object, step);
|
|
1774
1954
|
var valueSideChannel = getSideChannel();
|
|
1775
1955
|
valueSideChannel.set(sentinel, sideChannel);
|
|
1776
|
-
pushToArray(values, stringify(value, keyPrefix, generateArrayPrefix, commaRoundTrip, strictNullHandling, skipNulls, generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, valueSideChannel));
|
|
1956
|
+
pushToArray(values, stringify(value, keyPrefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, valueSideChannel));
|
|
1777
1957
|
}
|
|
1778
1958
|
return values;
|
|
1779
1959
|
};
|
|
@@ -1781,6 +1961,12 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
|
1781
1961
|
if (!opts) {
|
|
1782
1962
|
return defaults;
|
|
1783
1963
|
}
|
|
1964
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
1965
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
1966
|
+
}
|
|
1967
|
+
if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
|
|
1968
|
+
throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
1969
|
+
}
|
|
1784
1970
|
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
1785
1971
|
throw new TypeError('Encoder has to be a function.');
|
|
1786
1972
|
}
|
|
@@ -1800,13 +1986,29 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
|
1800
1986
|
if (typeof opts.filter === 'function' || isArray(opts.filter)) {
|
|
1801
1987
|
filter = opts.filter;
|
|
1802
1988
|
}
|
|
1989
|
+
var arrayFormat;
|
|
1990
|
+
if (opts.arrayFormat in arrayPrefixGenerators) {
|
|
1991
|
+
arrayFormat = opts.arrayFormat;
|
|
1992
|
+
} else if ('indices' in opts) {
|
|
1993
|
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
1994
|
+
} else {
|
|
1995
|
+
arrayFormat = defaults.arrayFormat;
|
|
1996
|
+
}
|
|
1997
|
+
if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
1998
|
+
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
1999
|
+
}
|
|
2000
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
1803
2001
|
return {
|
|
1804
2002
|
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
|
1805
|
-
allowDots:
|
|
2003
|
+
allowDots: allowDots,
|
|
2004
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
2005
|
+
arrayFormat: arrayFormat,
|
|
1806
2006
|
charset: charset,
|
|
1807
2007
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
2008
|
+
commaRoundTrip: opts.commaRoundTrip,
|
|
1808
2009
|
delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
|
|
1809
2010
|
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
|
|
2011
|
+
encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
|
|
1810
2012
|
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
|
|
1811
2013
|
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
|
1812
2014
|
filter: filter,
|
|
@@ -1834,19 +2036,8 @@ module.exports = function (object, opts) {
|
|
|
1834
2036
|
if (typeof obj !== 'object' || obj === null) {
|
|
1835
2037
|
return '';
|
|
1836
2038
|
}
|
|
1837
|
-
var arrayFormat;
|
|
1838
|
-
|
|
1839
|
-
arrayFormat = opts.arrayFormat;
|
|
1840
|
-
} else if (opts && 'indices' in opts) {
|
|
1841
|
-
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
1842
|
-
} else {
|
|
1843
|
-
arrayFormat = 'indices';
|
|
1844
|
-
}
|
|
1845
|
-
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
1846
|
-
if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
1847
|
-
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
1848
|
-
}
|
|
1849
|
-
var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
|
|
2039
|
+
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
|
|
2040
|
+
var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
|
|
1850
2041
|
if (!objKeys) {
|
|
1851
2042
|
objKeys = Object.keys(obj);
|
|
1852
2043
|
}
|
|
@@ -1859,7 +2050,7 @@ module.exports = function (object, opts) {
|
|
|
1859
2050
|
if (options.skipNulls && obj[key] === null) {
|
|
1860
2051
|
continue;
|
|
1861
2052
|
}
|
|
1862
|
-
pushToArray(keys, stringify(obj[key], key, generateArrayPrefix, commaRoundTrip, options.strictNullHandling, options.skipNulls, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.format, options.formatter, options.encodeValuesOnly, options.charset, sideChannel));
|
|
2053
|
+
pushToArray(keys, stringify(obj[key], key, generateArrayPrefix, commaRoundTrip, options.allowEmptyArrays, options.strictNullHandling, options.skipNulls, options.encodeDotInKeys, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.format, options.formatter, options.encodeValuesOnly, options.charset, sideChannel));
|
|
1863
2054
|
}
|
|
1864
2055
|
var joined = keys.join(options.delimiter);
|
|
1865
2056
|
var prefix = options.addQueryPrefix === true ? '?' : '';
|
|
@@ -1873,7 +2064,7 @@ module.exports = function (object, opts) {
|
|
|
1873
2064
|
return joined.length > 0 ? prefix + joined : '';
|
|
1874
2065
|
};
|
|
1875
2066
|
|
|
1876
|
-
},{"./formats":
|
|
2067
|
+
},{"./formats":26,"./utils":30,"side-channel":32}],30:[function(require,module,exports){
|
|
1877
2068
|
'use strict';
|
|
1878
2069
|
|
|
1879
2070
|
var formats = require('./formats');
|
|
@@ -1975,6 +2166,7 @@ var decode = function (str, decoder, charset) {
|
|
|
1975
2166
|
return strWithoutPlus;
|
|
1976
2167
|
}
|
|
1977
2168
|
};
|
|
2169
|
+
var limit = 1024;
|
|
1978
2170
|
var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
1979
2171
|
if (str.length === 0) {
|
|
1980
2172
|
return str;
|
|
@@ -1991,27 +2183,32 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
|
1991
2183
|
});
|
|
1992
2184
|
}
|
|
1993
2185
|
var out = '';
|
|
1994
|
-
for (var
|
|
1995
|
-
var
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2186
|
+
for (var j = 0; j < string.length; j += limit) {
|
|
2187
|
+
var segment = string.length >= limit ? string.slice(j, j + limit) : string;
|
|
2188
|
+
var arr = [];
|
|
2189
|
+
for (var i = 0; i < segment.length; ++i) {
|
|
2190
|
+
var c = segment.charCodeAt(i);
|
|
2191
|
+
if (c === 0x2D || c === 0x2E || c === 0x5F || c === 0x7E || c >= 0x30 && c <= 0x39 || c >= 0x41 && c <= 0x5A || c >= 0x61 && c <= 0x7A || format === formats.RFC1738 && (c === 0x28 || c === 0x29)) {
|
|
2192
|
+
arr[arr.length] = segment.charAt(i);
|
|
2193
|
+
continue;
|
|
2194
|
+
}
|
|
2195
|
+
if (c < 0x80) {
|
|
2196
|
+
arr[arr.length] = hexTable[c];
|
|
2197
|
+
continue;
|
|
2198
|
+
}
|
|
2199
|
+
if (c < 0x800) {
|
|
2200
|
+
arr[arr.length] = hexTable[0xC0 | c >> 6] + hexTable[0x80 | c & 0x3F];
|
|
2201
|
+
continue;
|
|
2202
|
+
}
|
|
2203
|
+
if (c < 0xD800 || c >= 0xE000) {
|
|
2204
|
+
arr[arr.length] = hexTable[0xE0 | c >> 12] + hexTable[0x80 | c >> 6 & 0x3F] + hexTable[0x80 | c & 0x3F];
|
|
2205
|
+
continue;
|
|
2206
|
+
}
|
|
2207
|
+
i += 1;
|
|
2208
|
+
c = 0x10000 + ((c & 0x3FF) << 10 | segment.charCodeAt(i) & 0x3FF);
|
|
2209
|
+
arr[arr.length] = hexTable[0xF0 | c >> 18] + hexTable[0x80 | c >> 12 & 0x3F] + hexTable[0x80 | c >> 6 & 0x3F] + hexTable[0x80 | c & 0x3F];
|
|
2011
2210
|
}
|
|
2012
|
-
|
|
2013
|
-
c = 0x10000 + ((c & 0x3FF) << 10 | string.charCodeAt(i) & 0x3FF);
|
|
2014
|
-
out += hexTable[0xF0 | c >> 18] + hexTable[0x80 | c >> 12 & 0x3F] + hexTable[0x80 | c >> 6 & 0x3F] + hexTable[0x80 | c & 0x3F];
|
|
2211
|
+
out += arr.join('');
|
|
2015
2212
|
}
|
|
2016
2213
|
return out;
|
|
2017
2214
|
};
|
|
@@ -2077,13 +2274,51 @@ module.exports = {
|
|
|
2077
2274
|
merge: merge
|
|
2078
2275
|
};
|
|
2079
2276
|
|
|
2080
|
-
},{"./formats":
|
|
2277
|
+
},{"./formats":26}],31:[function(require,module,exports){
|
|
2278
|
+
'use strict';
|
|
2279
|
+
|
|
2280
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
2281
|
+
var define = require('define-data-property');
|
|
2282
|
+
var hasDescriptors = require('has-property-descriptors')();
|
|
2283
|
+
var gOPD = require('gopd');
|
|
2284
|
+
var $TypeError = require('es-errors/type');
|
|
2285
|
+
var $floor = GetIntrinsic('%Math.floor%');
|
|
2286
|
+
module.exports = function setFunctionLength(fn, length) {
|
|
2287
|
+
if (typeof fn !== 'function') {
|
|
2288
|
+
throw new $TypeError('`fn` is not a function');
|
|
2289
|
+
}
|
|
2290
|
+
if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
|
|
2291
|
+
throw new $TypeError('`length` must be a positive 32-bit integer');
|
|
2292
|
+
}
|
|
2293
|
+
var loose = arguments.length > 2 && !!arguments[2];
|
|
2294
|
+
var functionLengthIsConfigurable = true;
|
|
2295
|
+
var functionLengthIsWritable = true;
|
|
2296
|
+
if ('length' in fn && gOPD) {
|
|
2297
|
+
var desc = gOPD(fn, 'length');
|
|
2298
|
+
if (desc && !desc.configurable) {
|
|
2299
|
+
functionLengthIsConfigurable = false;
|
|
2300
|
+
}
|
|
2301
|
+
if (desc && !desc.writable) {
|
|
2302
|
+
functionLengthIsWritable = false;
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
|
2306
|
+
if (hasDescriptors) {
|
|
2307
|
+
define(fn, 'length', length, true, true);
|
|
2308
|
+
} else {
|
|
2309
|
+
define(fn, 'length', length);
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
return fn;
|
|
2313
|
+
};
|
|
2314
|
+
|
|
2315
|
+
},{"define-data-property":5,"es-errors/type":12,"get-intrinsic":17,"gopd":18,"has-property-descriptors":19}],32:[function(require,module,exports){
|
|
2081
2316
|
'use strict';
|
|
2082
2317
|
|
|
2083
2318
|
var GetIntrinsic = require('get-intrinsic');
|
|
2084
2319
|
var callBound = require('call-bind/callBound');
|
|
2085
2320
|
var inspect = require('object-inspect');
|
|
2086
|
-
var $TypeError =
|
|
2321
|
+
var $TypeError = require('es-errors/type');
|
|
2087
2322
|
var $WeakMap = GetIntrinsic('%WeakMap%', true);
|
|
2088
2323
|
var $Map = GetIntrinsic('%Map%', true);
|
|
2089
2324
|
var $weakMapGet = callBound('WeakMap.prototype.get', true);
|
|
@@ -2093,7 +2328,9 @@ var $mapGet = callBound('Map.prototype.get', true);
|
|
|
2093
2328
|
var $mapSet = callBound('Map.prototype.set', true);
|
|
2094
2329
|
var $mapHas = callBound('Map.prototype.has', true);
|
|
2095
2330
|
var listGetNode = function (list, key) {
|
|
2096
|
-
|
|
2331
|
+
var prev = list;
|
|
2332
|
+
var curr;
|
|
2333
|
+
for (; (curr = prev.next) !== null; prev = curr) {
|
|
2097
2334
|
if (curr.key === key) {
|
|
2098
2335
|
prev.next = curr.next;
|
|
2099
2336
|
curr.next = list.next;
|
|
@@ -2187,11 +2424,19 @@ module.exports = function getSideChannel() {
|
|
|
2187
2424
|
return channel;
|
|
2188
2425
|
};
|
|
2189
2426
|
|
|
2190
|
-
},{"call-bind/callBound":2,"get-intrinsic":
|
|
2191
|
-
|
|
2192
|
-
|
|
2427
|
+
},{"call-bind/callBound":2,"es-errors/type":12,"get-intrinsic":17,"object-inspect":24}],33:[function(require,module,exports){
|
|
2428
|
+
const defaults = ['use', 'on', 'once', 'set', 'query', 'type', 'accept', 'auth', 'withCredentials', 'sortQuery', 'retry', 'ok', 'redirects', 'timeout', 'buffer', 'serialize', 'parse', 'ca', 'key', 'pfx', 'cert', 'disableTLSCerts'];
|
|
2429
|
+
class Agent {
|
|
2430
|
+
constructor() {
|
|
2431
|
+
this._defaults = [];
|
|
2432
|
+
}
|
|
2433
|
+
_setDefaults(request) {
|
|
2434
|
+
for (const def of this._defaults) {
|
|
2435
|
+
request[def.fn](...def.args);
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2193
2438
|
}
|
|
2194
|
-
for (const fn of
|
|
2439
|
+
for (const fn of defaults) {
|
|
2195
2440
|
Agent.prototype[fn] = function () {
|
|
2196
2441
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2197
2442
|
args[_key] = arguments[_key];
|
|
@@ -2203,14 +2448,9 @@ for (const fn of ['use', 'on', 'once', 'set', 'query', 'type', 'accept', 'auth',
|
|
|
2203
2448
|
return this;
|
|
2204
2449
|
};
|
|
2205
2450
|
}
|
|
2206
|
-
Agent.prototype._setDefaults = function (request) {
|
|
2207
|
-
for (const def of this._defaults) {
|
|
2208
|
-
request[def.fn](...def.args);
|
|
2209
|
-
}
|
|
2210
|
-
};
|
|
2211
2451
|
module.exports = Agent;
|
|
2212
2452
|
|
|
2213
|
-
},{}],
|
|
2453
|
+
},{}],34:[function(require,module,exports){
|
|
2214
2454
|
let root;
|
|
2215
2455
|
if (typeof window !== 'undefined') {
|
|
2216
2456
|
root = window;
|
|
@@ -2693,7 +2933,7 @@ request.put = (url, data, fn) => {
|
|
|
2693
2933
|
return request_;
|
|
2694
2934
|
};
|
|
2695
2935
|
|
|
2696
|
-
},{"./agent-base":
|
|
2936
|
+
},{"./agent-base":33,"./request-base":35,"./response-base":36,"./utils":37,"component-emitter":4,"fast-safe-stringify":14,"qs":27}],35:[function(require,module,exports){
|
|
2697
2937
|
(function (process){(function (){
|
|
2698
2938
|
const semver = require('semver');
|
|
2699
2939
|
const {
|
|
@@ -2963,7 +3203,7 @@ RequestBase.prototype.send = function (data) {
|
|
|
2963
3203
|
}
|
|
2964
3204
|
if (isObject_ && isObject(this._data)) {
|
|
2965
3205
|
for (const key in data) {
|
|
2966
|
-
if (typeof data[key] ==
|
|
3206
|
+
if (typeof data[key] == 'bigint' && !data[key].toJSON) throw new Error('Cannot serialize BigInt value to json');
|
|
2967
3207
|
if (hasOwn(data, key)) this._data[key] = data[key];
|
|
2968
3208
|
}
|
|
2969
3209
|
} else if (typeof data === 'bigint') throw new Error("Cannot send value of type BigInt");else if (typeof data === 'string') {
|
|
@@ -3038,7 +3278,7 @@ RequestBase.prototype._setTimeouts = function () {
|
|
|
3038
3278
|
};
|
|
3039
3279
|
|
|
3040
3280
|
}).call(this)}).call(this,require('_process'))
|
|
3041
|
-
},{"./utils":
|
|
3281
|
+
},{"./utils":37,"_process":25,"semver":1}],36:[function(require,module,exports){
|
|
3042
3282
|
const utils = require('./utils');
|
|
3043
3283
|
module.exports = ResponseBase;
|
|
3044
3284
|
function ResponseBase() {}
|
|
@@ -3081,7 +3321,7 @@ ResponseBase.prototype._setStatusProperties = function (status) {
|
|
|
3081
3321
|
this.unprocessableEntity = status === 422;
|
|
3082
3322
|
};
|
|
3083
3323
|
|
|
3084
|
-
},{"./utils":
|
|
3324
|
+
},{"./utils":37}],37:[function(require,module,exports){
|
|
3085
3325
|
exports.type = string_ => string_.split(/ *; */).shift();
|
|
3086
3326
|
exports.params = value => {
|
|
3087
3327
|
const object = {};
|
|
@@ -3131,5 +3371,5 @@ exports.mixin = (target, source) => {
|
|
|
3131
3371
|
}
|
|
3132
3372
|
};
|
|
3133
3373
|
|
|
3134
|
-
},{}]},{},[
|
|
3374
|
+
},{}]},{},[34])(34)
|
|
3135
3375
|
});
|