superagent 10.1.1 → 10.2.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.
@@ -3,48 +3,53 @@
3
3
  },{}],2:[function(require,module,exports){
4
4
  'use strict';
5
5
 
6
- var GetIntrinsic = require('get-intrinsic');
7
- var callBind = require('./');
8
- var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
9
- module.exports = function callBoundIntrinsic(name, allowMissing) {
10
- var intrinsic = GetIntrinsic(name, !!allowMissing);
11
- if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
12
- return callBind(intrinsic);
13
- }
14
- return intrinsic;
15
- };
6
+ var bind = require('function-bind');
7
+ var $apply = require('./functionApply');
8
+ var $call = require('./functionCall');
9
+ var $reflectApply = require('./reflectApply');
10
+ module.exports = $reflectApply || bind.call($call, $apply);
16
11
 
17
- },{"./":3,"get-intrinsic":17}],3:[function(require,module,exports){
12
+ },{"./functionApply":3,"./functionCall":4,"./reflectApply":6,"function-bind":21}],3:[function(require,module,exports){
13
+ 'use strict';
14
+ module.exports = Function.prototype.apply;
15
+
16
+ },{}],4:[function(require,module,exports){
17
+ 'use strict';
18
+ module.exports = Function.prototype.call;
19
+
20
+ },{}],5:[function(require,module,exports){
18
21
  'use strict';
19
22
 
20
23
  var bind = require('function-bind');
21
- var GetIntrinsic = require('get-intrinsic');
22
- var setFunctionLength = require('set-function-length');
23
24
  var $TypeError = require('es-errors/type');
24
- var $apply = GetIntrinsic('%Function.prototype.apply%');
25
- var $call = GetIntrinsic('%Function.prototype.call%');
26
- var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
27
- var $defineProperty = require('es-define-property');
28
- var $max = GetIntrinsic('%Math.max%');
29
- module.exports = function callBind(originalFunction) {
30
- if (typeof originalFunction !== 'function') {
25
+ var $call = require('./functionCall');
26
+ var $actualApply = require('./actualApply');
27
+ module.exports = function callBindBasic(args) {
28
+ if (args.length < 1 || typeof args[0] !== 'function') {
31
29
  throw new $TypeError('a function is required');
32
30
  }
33
- var func = $reflectApply(bind, $call, arguments);
34
- return setFunctionLength(func, 1 + $max(0, originalFunction.length - (arguments.length - 1)), true);
31
+ return $actualApply(bind, $call, args);
35
32
  };
36
- var applyBind = function applyBind() {
37
- return $reflectApply(bind, $apply, arguments);
33
+
34
+ },{"./actualApply":2,"./functionCall":4,"es-errors/type":16,"function-bind":21}],6:[function(require,module,exports){
35
+ 'use strict';
36
+ module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
37
+
38
+ },{}],7:[function(require,module,exports){
39
+ 'use strict';
40
+
41
+ var GetIntrinsic = require('get-intrinsic');
42
+ var callBindBasic = require('call-bind-apply-helpers');
43
+ var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);
44
+ module.exports = function callBoundIntrinsic(name, allowMissing) {
45
+ var intrinsic = GetIntrinsic(name, !!allowMissing);
46
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
47
+ return callBindBasic([intrinsic]);
48
+ }
49
+ return intrinsic;
38
50
  };
39
- if ($defineProperty) {
40
- $defineProperty(module.exports, 'apply', {
41
- value: applyBind
42
- });
43
- } else {
44
- module.exports.apply = applyBind;
45
- }
46
51
 
47
- },{"es-define-property":6,"es-errors/type":12,"function-bind":16,"get-intrinsic":17,"set-function-length":30}],4:[function(require,module,exports){
52
+ },{"call-bind-apply-helpers":5,"get-intrinsic":22}],8:[function(require,module,exports){
48
53
  if (typeof module !== 'undefined') {
49
54
  module.exports = Emitter;
50
55
  }
@@ -120,56 +125,29 @@ Emitter.prototype.hasListeners = function (event) {
120
125
  return !!this.listeners(event).length;
121
126
  };
122
127
 
123
- },{}],5:[function(require,module,exports){
128
+ },{}],9:[function(require,module,exports){
124
129
  'use strict';
125
130
 
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.');
131
+ var callBind = require('call-bind-apply-helpers');
132
+ var gOPD = require('gopd');
133
+ var hasProtoAccessor;
134
+ try {
135
+ hasProtoAccessor = [].__proto__ === Array.prototype;
136
+ } catch (e) {
137
+ if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
138
+ throw e;
165
139
  }
166
- };
140
+ }
141
+ var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, '__proto__');
142
+ var $Object = Object;
143
+ var $getPrototypeOf = $Object.getPrototypeOf;
144
+ module.exports = desc && typeof desc.get === 'function' ? callBind([desc.get]) : typeof $getPrototypeOf === 'function' ? function getDunder(value) {
145
+ return $getPrototypeOf(value == null ? value : $Object(value));
146
+ } : false;
167
147
 
168
- },{"es-define-property":6,"es-errors/syntax":11,"es-errors/type":12,"gopd":18}],6:[function(require,module,exports){
148
+ },{"call-bind-apply-helpers":5,"gopd":27}],10:[function(require,module,exports){
169
149
  'use strict';
170
-
171
- var GetIntrinsic = require('get-intrinsic');
172
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;
150
+ var $defineProperty = Object.defineProperty || false;
173
151
  if ($defineProperty) {
174
152
  try {
175
153
  $defineProperty({}, 'a', {
@@ -181,35 +159,39 @@ if ($defineProperty) {
181
159
  }
182
160
  module.exports = $defineProperty;
183
161
 
184
- },{"get-intrinsic":17}],7:[function(require,module,exports){
162
+ },{}],11:[function(require,module,exports){
185
163
  'use strict';
186
164
  module.exports = EvalError;
187
165
 
188
- },{}],8:[function(require,module,exports){
166
+ },{}],12:[function(require,module,exports){
189
167
  'use strict';
190
168
  module.exports = Error;
191
169
 
192
- },{}],9:[function(require,module,exports){
170
+ },{}],13:[function(require,module,exports){
193
171
  'use strict';
194
172
  module.exports = RangeError;
195
173
 
196
- },{}],10:[function(require,module,exports){
174
+ },{}],14:[function(require,module,exports){
197
175
  'use strict';
198
176
  module.exports = ReferenceError;
199
177
 
200
- },{}],11:[function(require,module,exports){
178
+ },{}],15:[function(require,module,exports){
201
179
  'use strict';
202
180
  module.exports = SyntaxError;
203
181
 
204
- },{}],12:[function(require,module,exports){
182
+ },{}],16:[function(require,module,exports){
205
183
  'use strict';
206
184
  module.exports = TypeError;
207
185
 
208
- },{}],13:[function(require,module,exports){
186
+ },{}],17:[function(require,module,exports){
209
187
  'use strict';
210
188
  module.exports = URIError;
211
189
 
212
- },{}],14:[function(require,module,exports){
190
+ },{}],18:[function(require,module,exports){
191
+ 'use strict';
192
+ module.exports = Object;
193
+
194
+ },{}],19:[function(require,module,exports){
213
195
  module.exports = stringify;
214
196
  stringify.default = stringify;
215
197
  stringify.stable = deterministicStringify;
@@ -401,7 +383,7 @@ function replaceGetterValues(replacer) {
401
383
  };
402
384
  }
403
385
 
404
- },{}],15:[function(require,module,exports){
386
+ },{}],20:[function(require,module,exports){
405
387
  'use strict';
406
388
  var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
407
389
  var toStr = Object.prototype.toString;
@@ -466,16 +448,17 @@ module.exports = function bind(that) {
466
448
  return bound;
467
449
  };
468
450
 
469
- },{}],16:[function(require,module,exports){
451
+ },{}],21:[function(require,module,exports){
470
452
  'use strict';
471
453
 
472
454
  var implementation = require('./implementation');
473
455
  module.exports = Function.prototype.bind || implementation;
474
456
 
475
- },{"./implementation":15}],17:[function(require,module,exports){
457
+ },{"./implementation":20}],22:[function(require,module,exports){
476
458
  'use strict';
477
459
 
478
460
  var undefined;
461
+ var $Object = require('es-object-atoms');
479
462
  var $Error = require('es-errors');
480
463
  var $EvalError = require('es-errors/eval');
481
464
  var $RangeError = require('es-errors/range');
@@ -483,20 +466,21 @@ var $ReferenceError = require('es-errors/ref');
483
466
  var $SyntaxError = require('es-errors/syntax');
484
467
  var $TypeError = require('es-errors/type');
485
468
  var $URIError = require('es-errors/uri');
469
+ var abs = require('math-intrinsics/abs');
470
+ var floor = require('math-intrinsics/floor');
471
+ var max = require('math-intrinsics/max');
472
+ var min = require('math-intrinsics/min');
473
+ var pow = require('math-intrinsics/pow');
474
+ var round = require('math-intrinsics/round');
475
+ var sign = require('math-intrinsics/sign');
486
476
  var $Function = Function;
487
477
  var getEvalledConstructor = function (expressionSyntax) {
488
478
  try {
489
479
  return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
490
480
  } catch (e) {}
491
481
  };
492
- var $gOPD = Object.getOwnPropertyDescriptor;
493
- if ($gOPD) {
494
- try {
495
- $gOPD({}, '');
496
- } catch (e) {
497
- $gOPD = null;
498
- }
499
- }
482
+ var $gOPD = require('gopd');
483
+ var $defineProperty = require('es-define-property');
500
484
  var throwTypeError = function () {
501
485
  throw new $TypeError();
502
486
  };
@@ -513,10 +497,11 @@ var ThrowTypeError = $gOPD ? function () {
513
497
  }
514
498
  }() : throwTypeError;
515
499
  var hasSymbols = require('has-symbols')();
516
- var hasProto = require('has-proto')();
517
- var getProto = Object.getPrototypeOf || (hasProto ? function (x) {
518
- return x.__proto__;
519
- } : null);
500
+ var getProto = require('get-proto');
501
+ var $ObjectGPO = require('get-proto/Object.getPrototypeOf');
502
+ var $ReflectGPO = require('get-proto/Reflect.getPrototypeOf');
503
+ var $apply = require('call-bind-apply-helpers/functionApply');
504
+ var $call = require('call-bind-apply-helpers/functionCall');
520
505
  var needsEval = {};
521
506
  var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
522
507
  var INTRINSICS = {
@@ -544,6 +529,7 @@ var INTRINSICS = {
544
529
  '%Error%': $Error,
545
530
  '%eval%': eval,
546
531
  '%EvalError%': $EvalError,
532
+ '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array,
547
533
  '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
548
534
  '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
549
535
  '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
@@ -560,7 +546,8 @@ var INTRINSICS = {
560
546
  '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
561
547
  '%Math%': Math,
562
548
  '%Number%': Number,
563
- '%Object%': Object,
549
+ '%Object%': $Object,
550
+ '%Object.getOwnPropertyDescriptor%': $gOPD,
564
551
  '%parseFloat%': parseFloat,
565
552
  '%parseInt%': parseInt,
566
553
  '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
@@ -586,7 +573,19 @@ var INTRINSICS = {
586
573
  '%URIError%': $URIError,
587
574
  '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
588
575
  '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
589
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
576
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
577
+ '%Function.prototype.call%': $call,
578
+ '%Function.prototype.apply%': $apply,
579
+ '%Object.defineProperty%': $defineProperty,
580
+ '%Object.getPrototypeOf%': $ObjectGPO,
581
+ '%Math.abs%': abs,
582
+ '%Math.floor%': floor,
583
+ '%Math.max%': max,
584
+ '%Math.min%': min,
585
+ '%Math.pow%': pow,
586
+ '%Math.round%': round,
587
+ '%Math.sign%': sign,
588
+ '%Reflect.getPrototypeOf%': $ReflectGPO
590
589
  };
591
590
  if (getProto) {
592
591
  try {
@@ -674,11 +673,11 @@ var LEGACY_ALIASES = {
674
673
  };
675
674
  var bind = require('function-bind');
676
675
  var hasOwn = require('hasown');
677
- var $concat = bind.call(Function.call, Array.prototype.concat);
678
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
679
- var $replace = bind.call(Function.call, String.prototype.replace);
680
- var $strSlice = bind.call(Function.call, String.prototype.slice);
681
- var $exec = bind.call(Function.call, RegExp.prototype.exec);
676
+ var $concat = bind.call($call, Array.prototype.concat);
677
+ var $spliceApply = bind.call($apply, Array.prototype.splice);
678
+ var $replace = bind.call($call, String.prototype.replace);
679
+ var $strSlice = bind.call($call, String.prototype.slice);
680
+ var $exec = bind.call($call, RegExp.prototype.exec);
682
681
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
683
682
  var reEscapeChar = /\\(\\)?/g;
684
683
  var stringToPath = function stringToPath(string) {
@@ -780,11 +779,40 @@ module.exports = function GetIntrinsic(name, allowMissing) {
780
779
  return value;
781
780
  };
782
781
 
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){
782
+ },{"call-bind-apply-helpers/functionApply":3,"call-bind-apply-helpers/functionCall":4,"es-define-property":10,"es-errors":12,"es-errors/eval":11,"es-errors/range":13,"es-errors/ref":14,"es-errors/syntax":15,"es-errors/type":16,"es-errors/uri":17,"es-object-atoms":18,"function-bind":21,"get-proto":25,"get-proto/Object.getPrototypeOf":23,"get-proto/Reflect.getPrototypeOf":24,"gopd":27,"has-symbols":28,"hasown":30,"math-intrinsics/abs":31,"math-intrinsics/floor":32,"math-intrinsics/max":34,"math-intrinsics/min":35,"math-intrinsics/pow":36,"math-intrinsics/round":37,"math-intrinsics/sign":38}],23:[function(require,module,exports){
784
783
  'use strict';
785
784
 
786
- var GetIntrinsic = require('get-intrinsic');
787
- var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
785
+ var $Object = require('es-object-atoms');
786
+ module.exports = $Object.getPrototypeOf || null;
787
+
788
+ },{"es-object-atoms":18}],24:[function(require,module,exports){
789
+ 'use strict';
790
+ module.exports = typeof Reflect !== 'undefined' && Reflect.getPrototypeOf || null;
791
+
792
+ },{}],25:[function(require,module,exports){
793
+ 'use strict';
794
+
795
+ var reflectGetProto = require('./Reflect.getPrototypeOf');
796
+ var originalGetProto = require('./Object.getPrototypeOf');
797
+ var getDunderProto = require('dunder-proto/get');
798
+ module.exports = reflectGetProto ? function getProto(O) {
799
+ return reflectGetProto(O);
800
+ } : originalGetProto ? function getProto(O) {
801
+ if (!O || typeof O !== 'object' && typeof O !== 'function') {
802
+ throw new TypeError('getProto: not an object');
803
+ }
804
+ return originalGetProto(O);
805
+ } : getDunderProto ? function getProto(O) {
806
+ return getDunderProto(O);
807
+ } : null;
808
+
809
+ },{"./Object.getPrototypeOf":23,"./Reflect.getPrototypeOf":24,"dunder-proto/get":9}],26:[function(require,module,exports){
810
+ 'use strict';
811
+ module.exports = Object.getOwnPropertyDescriptor;
812
+
813
+ },{}],27:[function(require,module,exports){
814
+ 'use strict';
815
+ var $gOPD = require('./gOPD');
788
816
  if ($gOPD) {
789
817
  try {
790
818
  $gOPD([], 'length');
@@ -794,42 +822,7 @@ if ($gOPD) {
794
822
  }
795
823
  module.exports = $gOPD;
796
824
 
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){
819
- 'use strict';
820
-
821
- var test = {
822
- __proto__: null,
823
- foo: {}
824
- };
825
- var $Object = Object;
826
- module.exports = function hasProto() {
827
- return {
828
- __proto__: test
829
- }.foo === test.foo && !(test instanceof $Object);
830
- };
831
-
832
- },{}],21:[function(require,module,exports){
825
+ },{"./gOPD":26}],28:[function(require,module,exports){
833
826
  'use strict';
834
827
 
835
828
  var origSymbol = typeof Symbol !== 'undefined' && Symbol;
@@ -850,7 +843,7 @@ module.exports = function hasNativeSymbols() {
850
843
  return hasSymbolSham();
851
844
  };
852
845
 
853
- },{"./shams":22}],22:[function(require,module,exports){
846
+ },{"./shams":29}],29:[function(require,module,exports){
854
847
  'use strict';
855
848
  module.exports = function hasSymbols() {
856
849
  if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') {
@@ -873,7 +866,7 @@ module.exports = function hasSymbols() {
873
866
  }
874
867
  var symVal = 42;
875
868
  obj[sym] = symVal;
876
- for (sym in obj) {
869
+ for (var _ in obj) {
877
870
  return false;
878
871
  }
879
872
  if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) {
@@ -898,7 +891,7 @@ module.exports = function hasSymbols() {
898
891
  return true;
899
892
  };
900
893
 
901
- },{}],23:[function(require,module,exports){
894
+ },{}],30:[function(require,module,exports){
902
895
  'use strict';
903
896
 
904
897
  var call = Function.prototype.call;
@@ -906,7 +899,48 @@ var $hasOwn = Object.prototype.hasOwnProperty;
906
899
  var bind = require('function-bind');
907
900
  module.exports = bind.call(call, $hasOwn);
908
901
 
909
- },{"function-bind":16}],24:[function(require,module,exports){
902
+ },{"function-bind":21}],31:[function(require,module,exports){
903
+ 'use strict';
904
+ module.exports = Math.abs;
905
+
906
+ },{}],32:[function(require,module,exports){
907
+ 'use strict';
908
+ module.exports = Math.floor;
909
+
910
+ },{}],33:[function(require,module,exports){
911
+ 'use strict';
912
+ module.exports = Number.isNaN || function isNaN(a) {
913
+ return a !== a;
914
+ };
915
+
916
+ },{}],34:[function(require,module,exports){
917
+ 'use strict';
918
+ module.exports = Math.max;
919
+
920
+ },{}],35:[function(require,module,exports){
921
+ 'use strict';
922
+ module.exports = Math.min;
923
+
924
+ },{}],36:[function(require,module,exports){
925
+ 'use strict';
926
+ module.exports = Math.pow;
927
+
928
+ },{}],37:[function(require,module,exports){
929
+ 'use strict';
930
+ module.exports = Math.round;
931
+
932
+ },{}],38:[function(require,module,exports){
933
+ 'use strict';
934
+
935
+ var $isNaN = require('./isNaN');
936
+ module.exports = function sign(number) {
937
+ if ($isNaN(number) || number === 0) {
938
+ return number;
939
+ }
940
+ return number < 0 ? -1 : +1;
941
+ };
942
+
943
+ },{"./isNaN":33}],39:[function(require,module,exports){
910
944
  (function (global){(function (){
911
945
  var hasMap = typeof Map === 'function' && Map.prototype;
912
946
  var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
@@ -962,9 +996,19 @@ function addNumericSeparator(num, str) {
962
996
  var utilInspect = require('./util.inspect');
963
997
  var inspectCustom = utilInspect.custom;
964
998
  var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
999
+ var quotes = {
1000
+ __proto__: null,
1001
+ 'double': '"',
1002
+ single: "'"
1003
+ };
1004
+ var quoteREs = {
1005
+ __proto__: null,
1006
+ 'double': /(["\\])/g,
1007
+ single: /(['\\])/g
1008
+ };
965
1009
  module.exports = function inspect_(obj, options, depth, seen) {
966
1010
  var opts = options || {};
967
- if (has(opts, 'quoteStyle') && opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double') {
1011
+ if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) {
968
1012
  throw new TypeError('option "quoteStyle" must be "single" or "double"');
969
1013
  }
970
1014
  if (has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) {
@@ -1147,32 +1191,36 @@ module.exports = function inspect_(obj, options, depth, seen) {
1147
1191
  return String(obj);
1148
1192
  };
1149
1193
  function wrapQuotes(s, defaultStyle, opts) {
1150
- var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
1194
+ var style = opts.quoteStyle || defaultStyle;
1195
+ var quoteChar = quotes[style];
1151
1196
  return quoteChar + s + quoteChar;
1152
1197
  }
1153
1198
  function quote(s) {
1154
1199
  return $replace.call(String(s), /"/g, '&quot;');
1155
1200
  }
1201
+ function canTrustToString(obj) {
1202
+ return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined'));
1203
+ }
1156
1204
  function isArray(obj) {
1157
- return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj));
1205
+ return toStr(obj) === '[object Array]' && canTrustToString(obj);
1158
1206
  }
1159
1207
  function isDate(obj) {
1160
- return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj));
1208
+ return toStr(obj) === '[object Date]' && canTrustToString(obj);
1161
1209
  }
1162
1210
  function isRegExp(obj) {
1163
- return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj));
1211
+ return toStr(obj) === '[object RegExp]' && canTrustToString(obj);
1164
1212
  }
1165
1213
  function isError(obj) {
1166
- return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj));
1214
+ return toStr(obj) === '[object Error]' && canTrustToString(obj);
1167
1215
  }
1168
1216
  function isString(obj) {
1169
- return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj));
1217
+ return toStr(obj) === '[object String]' && canTrustToString(obj);
1170
1218
  }
1171
1219
  function isNumber(obj) {
1172
- return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj));
1220
+ return toStr(obj) === '[object Number]' && canTrustToString(obj);
1173
1221
  }
1174
1222
  function isBoolean(obj) {
1175
- return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj));
1223
+ return toStr(obj) === '[object Boolean]' && canTrustToString(obj);
1176
1224
  }
1177
1225
  function isSymbol(obj) {
1178
1226
  if (hasShammedSymbols) {
@@ -1315,7 +1363,9 @@ function inspectString(str, opts) {
1315
1363
  var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
1316
1364
  return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
1317
1365
  }
1318
- var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
1366
+ var quoteRE = quoteREs[opts.quoteStyle || 'single'];
1367
+ quoteRE.lastIndex = 0;
1368
+ var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte);
1319
1369
  return wrapQuotes(s, 'single', opts);
1320
1370
  }
1321
1371
  function lowbyte(c) {
@@ -1414,7 +1464,7 @@ function arrObjKeys(obj, inspect) {
1414
1464
  }
1415
1465
 
1416
1466
  }).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){
1467
+ },{"./util.inspect":1}],40:[function(require,module,exports){
1418
1468
  'use strict';
1419
1469
 
1420
1470
  var replace = String.prototype.replace;
@@ -1437,7 +1487,7 @@ module.exports = {
1437
1487
  RFC3986: Format.RFC3986
1438
1488
  };
1439
1489
 
1440
- },{}],26:[function(require,module,exports){
1490
+ },{}],41:[function(require,module,exports){
1441
1491
  'use strict';
1442
1492
 
1443
1493
  var stringify = require('./stringify');
@@ -1449,7 +1499,7 @@ module.exports = {
1449
1499
  stringify: stringify
1450
1500
  };
1451
1501
 
1452
- },{"./formats":25,"./parse":27,"./stringify":28}],27:[function(require,module,exports){
1502
+ },{"./formats":40,"./parse":42,"./stringify":43}],42:[function(require,module,exports){
1453
1503
  'use strict';
1454
1504
 
1455
1505
  var utils = require('./utils');
@@ -1475,17 +1525,21 @@ var defaults = {
1475
1525
  parseArrays: true,
1476
1526
  plainObjects: false,
1477
1527
  strictDepth: false,
1478
- strictNullHandling: false
1528
+ strictNullHandling: false,
1529
+ throwOnLimitExceeded: false
1479
1530
  };
1480
1531
  var interpretNumericEntities = function (str) {
1481
1532
  return str.replace(/&#(\d+);/g, function ($0, numberStr) {
1482
1533
  return String.fromCharCode(parseInt(numberStr, 10));
1483
1534
  });
1484
1535
  };
1485
- var parseArrayValue = function (val, options) {
1536
+ var parseArrayValue = function (val, options, currentArrayLength) {
1486
1537
  if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
1487
1538
  return val.split(',');
1488
1539
  }
1540
+ if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
1541
+ throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
1542
+ }
1489
1543
  return val;
1490
1544
  };
1491
1545
  var isoSentinel = 'utf8=%26%2310003%3B';
@@ -1497,7 +1551,10 @@ var parseValues = function parseQueryStringValues(str, options) {
1497
1551
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
1498
1552
  cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
1499
1553
  var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
1500
- var parts = cleanStr.split(options.delimiter, limit);
1554
+ var parts = cleanStr.split(options.delimiter, options.throwOnLimitExceeded ? limit + 1 : limit);
1555
+ if (options.throwOnLimitExceeded && parts.length > limit) {
1556
+ throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');
1557
+ }
1501
1558
  var skipIndex = -1;
1502
1559
  var i;
1503
1560
  var charset = options.charset;
@@ -1521,18 +1578,19 @@ var parseValues = function parseQueryStringValues(str, options) {
1521
1578
  var part = parts[i];
1522
1579
  var bracketEqualsPos = part.indexOf(']=');
1523
1580
  var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
1524
- var key, val;
1581
+ var key;
1582
+ var val;
1525
1583
  if (pos === -1) {
1526
1584
  key = options.decoder(part, defaults.decoder, charset, 'key');
1527
1585
  val = options.strictNullHandling ? null : '';
1528
1586
  } else {
1529
1587
  key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
1530
- val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options), function (encodedVal) {
1588
+ val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function (encodedVal) {
1531
1589
  return options.decoder(encodedVal, defaults.decoder, charset, 'value');
1532
1590
  });
1533
1591
  }
1534
1592
  if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
1535
- val = interpretNumericEntities(val);
1593
+ val = interpretNumericEntities(String(val));
1536
1594
  }
1537
1595
  if (part.indexOf('[]=') > -1) {
1538
1596
  val = isArray(val) ? [val] : val;
@@ -1547,14 +1605,21 @@ var parseValues = function parseQueryStringValues(str, options) {
1547
1605
  return obj;
1548
1606
  };
1549
1607
  var parseObject = function (chain, val, options, valuesParsed) {
1550
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
1608
+ var currentArrayLength = 0;
1609
+ if (chain.length > 0 && chain[chain.length - 1] === '[]') {
1610
+ var parentKey = chain.slice(0, -1).join('');
1611
+ currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
1612
+ }
1613
+ var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
1551
1614
  for (var i = chain.length - 1; i >= 0; --i) {
1552
1615
  var obj;
1553
1616
  var root = chain[i];
1554
1617
  if (root === '[]' && options.parseArrays) {
1555
- obj = options.allowEmptyArrays && (leaf === '' || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf);
1618
+ obj = options.allowEmptyArrays && (leaf === '' || options.strictNullHandling && leaf === null) ? [] : utils.combine([], leaf);
1556
1619
  } else {
1557
- obj = options.plainObjects ? Object.create(null) : {};
1620
+ obj = options.plainObjects ? {
1621
+ __proto__: null
1622
+ } : {};
1558
1623
  var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
1559
1624
  var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
1560
1625
  var index = parseInt(decodedRoot, 10);
@@ -1625,6 +1690,9 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
1625
1690
  if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
1626
1691
  throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
1627
1692
  }
1693
+ if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') {
1694
+ throw new TypeError('`throwOnLimitExceeded` option must be a boolean');
1695
+ }
1628
1696
  var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
1629
1697
  var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
1630
1698
  if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
@@ -1651,16 +1719,21 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
1651
1719
  parseArrays: opts.parseArrays !== false,
1652
1720
  plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
1653
1721
  strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,
1654
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
1722
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,
1723
+ throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false
1655
1724
  };
1656
1725
  };
1657
1726
  module.exports = function (str, opts) {
1658
1727
  var options = normalizeParseOptions(opts);
1659
1728
  if (str === '' || str === null || typeof str === 'undefined') {
1660
- return options.plainObjects ? Object.create(null) : {};
1729
+ return options.plainObjects ? {
1730
+ __proto__: null
1731
+ } : {};
1661
1732
  }
1662
1733
  var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
1663
- var obj = options.plainObjects ? Object.create(null) : {};
1734
+ var obj = options.plainObjects ? {
1735
+ __proto__: null
1736
+ } : {};
1664
1737
  var keys = Object.keys(tempObj);
1665
1738
  for (var i = 0; i < keys.length; ++i) {
1666
1739
  var key = keys[i];
@@ -1673,7 +1746,7 @@ module.exports = function (str, opts) {
1673
1746
  return utils.compact(obj);
1674
1747
  };
1675
1748
 
1676
- },{"./utils":29}],28:[function(require,module,exports){
1749
+ },{"./utils":44}],43:[function(require,module,exports){
1677
1750
  'use strict';
1678
1751
 
1679
1752
  var getSideChannel = require('side-channel');
@@ -1706,11 +1779,13 @@ var defaults = {
1706
1779
  arrayFormat: 'indices',
1707
1780
  charset: 'utf-8',
1708
1781
  charsetSentinel: false,
1782
+ commaRoundTrip: false,
1709
1783
  delimiter: '&',
1710
1784
  encode: true,
1711
1785
  encodeDotInKeys: false,
1712
1786
  encoder: utils.encode,
1713
1787
  encodeValuesOnly: false,
1788
+ filter: void undefined,
1714
1789
  format: defaultFormat,
1715
1790
  formatter: formats.formatters[defaultFormat],
1716
1791
  indices: false,
@@ -1786,18 +1861,18 @@ var stringify = function stringify(object, prefix, generateArrayPrefix, commaRou
1786
1861
  var keys = Object.keys(obj);
1787
1862
  objKeys = sort ? keys.sort(sort) : keys;
1788
1863
  }
1789
- var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix;
1864
+ var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
1790
1865
  var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
1791
1866
  if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
1792
1867
  return adjustedPrefix + '[]';
1793
1868
  }
1794
1869
  for (var j = 0; j < objKeys.length; ++j) {
1795
1870
  var key = objKeys[j];
1796
- var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
1871
+ var value = typeof key === 'object' && key && typeof key.value !== 'undefined' ? key.value : obj[key];
1797
1872
  if (skipNulls && value === null) {
1798
1873
  continue;
1799
1874
  }
1800
- var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key;
1875
+ var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key);
1801
1876
  var keyPrefix = isArray(obj) ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
1802
1877
  sideChannel.set(object, step);
1803
1878
  var valueSideChannel = getSideChannel();
@@ -1854,7 +1929,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
1854
1929
  arrayFormat: arrayFormat,
1855
1930
  charset: charset,
1856
1931
  charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
1857
- commaRoundTrip: opts.commaRoundTrip,
1932
+ commaRoundTrip: !!opts.commaRoundTrip,
1858
1933
  delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
1859
1934
  encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
1860
1935
  encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
@@ -1896,10 +1971,11 @@ module.exports = function (object, opts) {
1896
1971
  var sideChannel = getSideChannel();
1897
1972
  for (var i = 0; i < objKeys.length; ++i) {
1898
1973
  var key = objKeys[i];
1899
- if (options.skipNulls && obj[key] === null) {
1974
+ var value = obj[key];
1975
+ if (options.skipNulls && value === null) {
1900
1976
  continue;
1901
1977
  }
1902
- 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));
1978
+ pushToArray(keys, stringify(value, 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));
1903
1979
  }
1904
1980
  var joined = keys.join(options.delimiter);
1905
1981
  var prefix = options.addQueryPrefix === true ? '?' : '';
@@ -1913,7 +1989,7 @@ module.exports = function (object, opts) {
1913
1989
  return joined.length > 0 ? prefix + joined : '';
1914
1990
  };
1915
1991
 
1916
- },{"./formats":25,"./utils":29,"side-channel":31}],29:[function(require,module,exports){
1992
+ },{"./formats":40,"./utils":44,"side-channel":48}],44:[function(require,module,exports){
1917
1993
  'use strict';
1918
1994
 
1919
1995
  var formats = require('./formats');
@@ -1942,7 +2018,9 @@ var compactQueue = function compactQueue(queue) {
1942
2018
  }
1943
2019
  };
1944
2020
  var arrayToObject = function arrayToObject(source, options) {
1945
- var obj = options && options.plainObjects ? Object.create(null) : {};
2021
+ var obj = options && options.plainObjects ? {
2022
+ __proto__: null
2023
+ } : {};
1946
2024
  for (var i = 0; i < source.length; ++i) {
1947
2025
  if (typeof source[i] !== 'undefined') {
1948
2026
  obj[i] = source[i];
@@ -1954,7 +2032,7 @@ var merge = function merge(target, source, options) {
1954
2032
  if (!source) {
1955
2033
  return target;
1956
2034
  }
1957
- if (typeof source !== 'object') {
2035
+ if (typeof source !== 'object' && typeof source !== 'function') {
1958
2036
  if (isArray(target)) {
1959
2037
  target.push(source);
1960
2038
  } else if (target && typeof target === 'object') {
@@ -2004,7 +2082,7 @@ var assign = function assignSingleSource(target, source) {
2004
2082
  return acc;
2005
2083
  }, target);
2006
2084
  };
2007
- var decode = function (str, decoder, charset) {
2085
+ var decode = function (str, defaultDecoder, charset) {
2008
2086
  var strWithoutPlus = str.replace(/\+/g, ' ');
2009
2087
  if (charset === 'iso-8859-1') {
2010
2088
  return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
@@ -2123,72 +2201,29 @@ module.exports = {
2123
2201
  merge: merge
2124
2202
  };
2125
2203
 
2126
- },{"./formats":25}],30:[function(require,module,exports){
2204
+ },{"./formats":40}],45:[function(require,module,exports){
2127
2205
  'use strict';
2128
2206
 
2129
- var GetIntrinsic = require('get-intrinsic');
2130
- var define = require('define-data-property');
2131
- var hasDescriptors = require('has-property-descriptors')();
2132
- var gOPD = require('gopd');
2133
- var $TypeError = require('es-errors/type');
2134
- var $floor = GetIntrinsic('%Math.floor%');
2135
- module.exports = function setFunctionLength(fn, length) {
2136
- if (typeof fn !== 'function') {
2137
- throw new $TypeError('`fn` is not a function');
2138
- }
2139
- if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
2140
- throw new $TypeError('`length` must be a positive 32-bit integer');
2141
- }
2142
- var loose = arguments.length > 2 && !!arguments[2];
2143
- var functionLengthIsConfigurable = true;
2144
- var functionLengthIsWritable = true;
2145
- if ('length' in fn && gOPD) {
2146
- var desc = gOPD(fn, 'length');
2147
- if (desc && !desc.configurable) {
2148
- functionLengthIsConfigurable = false;
2149
- }
2150
- if (desc && !desc.writable) {
2151
- functionLengthIsWritable = false;
2152
- }
2153
- }
2154
- if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
2155
- if (hasDescriptors) {
2156
- define(fn, 'length', length, true, true);
2157
- } else {
2158
- define(fn, 'length', length);
2159
- }
2160
- }
2161
- return fn;
2162
- };
2163
-
2164
- },{"define-data-property":5,"es-errors/type":12,"get-intrinsic":17,"gopd":18,"has-property-descriptors":19}],31:[function(require,module,exports){
2165
- 'use strict';
2166
-
2167
- var GetIntrinsic = require('get-intrinsic');
2168
- var callBound = require('call-bind/callBound');
2169
2207
  var inspect = require('object-inspect');
2170
2208
  var $TypeError = require('es-errors/type');
2171
- var $WeakMap = GetIntrinsic('%WeakMap%', true);
2172
- var $Map = GetIntrinsic('%Map%', true);
2173
- var $weakMapGet = callBound('WeakMap.prototype.get', true);
2174
- var $weakMapSet = callBound('WeakMap.prototype.set', true);
2175
- var $weakMapHas = callBound('WeakMap.prototype.has', true);
2176
- var $mapGet = callBound('Map.prototype.get', true);
2177
- var $mapSet = callBound('Map.prototype.set', true);
2178
- var $mapHas = callBound('Map.prototype.has', true);
2179
- var listGetNode = function (list, key) {
2209
+ var listGetNode = function (list, key, isDelete) {
2180
2210
  var prev = list;
2181
2211
  var curr;
2182
- for (; (curr = prev.next) !== null; prev = curr) {
2212
+ for (; (curr = prev.next) != null; prev = curr) {
2183
2213
  if (curr.key === key) {
2184
2214
  prev.next = curr.next;
2185
- curr.next = list.next;
2186
- list.next = curr;
2215
+ if (!isDelete) {
2216
+ curr.next = list.next;
2217
+ list.next = curr;
2218
+ }
2187
2219
  return curr;
2188
2220
  }
2189
2221
  }
2190
2222
  };
2191
2223
  var listGet = function (objects, key) {
2224
+ if (!objects) {
2225
+ return void undefined;
2226
+ }
2192
2227
  var node = listGetNode(objects, key);
2193
2228
  return node && node.value;
2194
2229
  };
@@ -2205,11 +2240,17 @@ var listSet = function (objects, key, value) {
2205
2240
  }
2206
2241
  };
2207
2242
  var listHas = function (objects, key) {
2243
+ if (!objects) {
2244
+ return false;
2245
+ }
2208
2246
  return !!listGetNode(objects, key);
2209
2247
  };
2210
- module.exports = function getSideChannel() {
2211
- var $wm;
2212
- var $m;
2248
+ var listDelete = function (objects, key) {
2249
+ if (objects) {
2250
+ return listGetNode(objects, key, true);
2251
+ }
2252
+ };
2253
+ module.exports = function getSideChannelList() {
2213
2254
  var $o;
2214
2255
  var channel = {
2215
2256
  assert: function (key) {
@@ -2217,36 +2258,133 @@ module.exports = function getSideChannel() {
2217
2258
  throw new $TypeError('Side channel does not contain ' + inspect(key));
2218
2259
  }
2219
2260
  },
2261
+ 'delete': function (key) {
2262
+ var root = $o && $o.next;
2263
+ var deletedNode = listDelete($o, key);
2264
+ if (deletedNode && root && root === deletedNode) {
2265
+ $o = void undefined;
2266
+ }
2267
+ return !!deletedNode;
2268
+ },
2269
+ get: function (key) {
2270
+ return listGet($o, key);
2271
+ },
2272
+ has: function (key) {
2273
+ return listHas($o, key);
2274
+ },
2275
+ set: function (key, value) {
2276
+ if (!$o) {
2277
+ $o = {
2278
+ next: void undefined
2279
+ };
2280
+ }
2281
+ listSet($o, key, value);
2282
+ }
2283
+ };
2284
+ return channel;
2285
+ };
2286
+
2287
+ },{"es-errors/type":16,"object-inspect":39}],46:[function(require,module,exports){
2288
+ 'use strict';
2289
+
2290
+ var GetIntrinsic = require('get-intrinsic');
2291
+ var callBound = require('call-bound');
2292
+ var inspect = require('object-inspect');
2293
+ var $TypeError = require('es-errors/type');
2294
+ var $Map = GetIntrinsic('%Map%', true);
2295
+ var $mapGet = callBound('Map.prototype.get', true);
2296
+ var $mapSet = callBound('Map.prototype.set', true);
2297
+ var $mapHas = callBound('Map.prototype.has', true);
2298
+ var $mapDelete = callBound('Map.prototype.delete', true);
2299
+ var $mapSize = callBound('Map.prototype.size', true);
2300
+ module.exports = !!$Map && function getSideChannelMap() {
2301
+ var $m;
2302
+ var channel = {
2303
+ assert: function (key) {
2304
+ if (!channel.has(key)) {
2305
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
2306
+ }
2307
+ },
2308
+ 'delete': function (key) {
2309
+ if ($m) {
2310
+ var result = $mapDelete($m, key);
2311
+ if ($mapSize($m) === 0) {
2312
+ $m = void undefined;
2313
+ }
2314
+ return result;
2315
+ }
2316
+ return false;
2317
+ },
2220
2318
  get: function (key) {
2319
+ if ($m) {
2320
+ return $mapGet($m, key);
2321
+ }
2322
+ },
2323
+ has: function (key) {
2324
+ if ($m) {
2325
+ return $mapHas($m, key);
2326
+ }
2327
+ return false;
2328
+ },
2329
+ set: function (key, value) {
2330
+ if (!$m) {
2331
+ $m = new $Map();
2332
+ }
2333
+ $mapSet($m, key, value);
2334
+ }
2335
+ };
2336
+ return channel;
2337
+ };
2338
+
2339
+ },{"call-bound":7,"es-errors/type":16,"get-intrinsic":22,"object-inspect":39}],47:[function(require,module,exports){
2340
+ 'use strict';
2341
+
2342
+ var GetIntrinsic = require('get-intrinsic');
2343
+ var callBound = require('call-bound');
2344
+ var inspect = require('object-inspect');
2345
+ var getSideChannelMap = require('side-channel-map');
2346
+ var $TypeError = require('es-errors/type');
2347
+ var $WeakMap = GetIntrinsic('%WeakMap%', true);
2348
+ var $weakMapGet = callBound('WeakMap.prototype.get', true);
2349
+ var $weakMapSet = callBound('WeakMap.prototype.set', true);
2350
+ var $weakMapHas = callBound('WeakMap.prototype.has', true);
2351
+ var $weakMapDelete = callBound('WeakMap.prototype.delete', true);
2352
+ module.exports = $WeakMap ? function getSideChannelWeakMap() {
2353
+ var $wm;
2354
+ var $m;
2355
+ var channel = {
2356
+ assert: function (key) {
2357
+ if (!channel.has(key)) {
2358
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
2359
+ }
2360
+ },
2361
+ 'delete': function (key) {
2221
2362
  if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
2222
2363
  if ($wm) {
2223
- return $weakMapGet($wm, key);
2364
+ return $weakMapDelete($wm, key);
2224
2365
  }
2225
- } else if ($Map) {
2366
+ } else if (getSideChannelMap) {
2226
2367
  if ($m) {
2227
- return $mapGet($m, key);
2368
+ return $m['delete'](key);
2228
2369
  }
2229
- } else {
2230
- if ($o) {
2231
- return listGet($o, key);
2370
+ }
2371
+ return false;
2372
+ },
2373
+ get: function (key) {
2374
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
2375
+ if ($wm) {
2376
+ return $weakMapGet($wm, key);
2232
2377
  }
2233
2378
  }
2379
+ return $m && $m.get(key);
2234
2380
  },
2235
2381
  has: function (key) {
2236
2382
  if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
2237
2383
  if ($wm) {
2238
2384
  return $weakMapHas($wm, key);
2239
2385
  }
2240
- } else if ($Map) {
2241
- if ($m) {
2242
- return $mapHas($m, key);
2243
- }
2244
- } else {
2245
- if ($o) {
2246
- return listHas($o, key);
2247
- }
2248
2386
  }
2249
- return false;
2387
+ return !!$m && $m.has(key);
2250
2388
  },
2251
2389
  set: function (key, value) {
2252
2390
  if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
@@ -2254,26 +2392,54 @@ module.exports = function getSideChannel() {
2254
2392
  $wm = new $WeakMap();
2255
2393
  }
2256
2394
  $weakMapSet($wm, key, value);
2257
- } else if ($Map) {
2395
+ } else if (getSideChannelMap) {
2258
2396
  if (!$m) {
2259
- $m = new $Map();
2260
- }
2261
- $mapSet($m, key, value);
2262
- } else {
2263
- if (!$o) {
2264
- $o = {
2265
- key: {},
2266
- next: null
2267
- };
2397
+ $m = getSideChannelMap();
2268
2398
  }
2269
- listSet($o, key, value);
2399
+ $m.set(key, value);
2270
2400
  }
2271
2401
  }
2272
2402
  };
2273
2403
  return channel;
2404
+ } : getSideChannelMap;
2405
+
2406
+ },{"call-bound":7,"es-errors/type":16,"get-intrinsic":22,"object-inspect":39,"side-channel-map":46}],48:[function(require,module,exports){
2407
+ 'use strict';
2408
+
2409
+ var $TypeError = require('es-errors/type');
2410
+ var inspect = require('object-inspect');
2411
+ var getSideChannelList = require('side-channel-list');
2412
+ var getSideChannelMap = require('side-channel-map');
2413
+ var getSideChannelWeakMap = require('side-channel-weakmap');
2414
+ var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;
2415
+ module.exports = function getSideChannel() {
2416
+ var $channelData;
2417
+ var channel = {
2418
+ assert: function (key) {
2419
+ if (!channel.has(key)) {
2420
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
2421
+ }
2422
+ },
2423
+ 'delete': function (key) {
2424
+ return !!$channelData && $channelData['delete'](key);
2425
+ },
2426
+ get: function (key) {
2427
+ return $channelData && $channelData.get(key);
2428
+ },
2429
+ has: function (key) {
2430
+ return !!$channelData && $channelData.has(key);
2431
+ },
2432
+ set: function (key, value) {
2433
+ if (!$channelData) {
2434
+ $channelData = makeChannel();
2435
+ }
2436
+ $channelData.set(key, value);
2437
+ }
2438
+ };
2439
+ return channel;
2274
2440
  };
2275
2441
 
2276
- },{"call-bind/callBound":2,"es-errors/type":12,"get-intrinsic":17,"object-inspect":24}],32:[function(require,module,exports){
2442
+ },{"es-errors/type":16,"object-inspect":39,"side-channel-list":45,"side-channel-map":46,"side-channel-weakmap":47}],49:[function(require,module,exports){
2277
2443
  const defaults = ['use', 'on', 'once', 'set', 'query', 'type', 'accept', 'auth', 'withCredentials', 'sortQuery', 'retry', 'ok', 'redirects', 'timeout', 'buffer', 'serialize', 'parse', 'ca', 'key', 'pfx', 'cert', 'disableTLSCerts'];
2278
2444
  class Agent {
2279
2445
  constructor() {
@@ -2299,7 +2465,7 @@ for (const fn of defaults) {
2299
2465
  }
2300
2466
  module.exports = Agent;
2301
2467
 
2302
- },{}],33:[function(require,module,exports){
2468
+ },{}],50:[function(require,module,exports){
2303
2469
  let root;
2304
2470
  if (typeof window !== 'undefined') {
2305
2471
  root = window;
@@ -2787,7 +2953,7 @@ request.put = (url, data, fn) => {
2787
2953
  return request_;
2788
2954
  };
2789
2955
 
2790
- },{"./agent-base":32,"./request-base":34,"./response-base":35,"./utils":36,"component-emitter":4,"fast-safe-stringify":14,"qs":26}],34:[function(require,module,exports){
2956
+ },{"./agent-base":49,"./request-base":51,"./response-base":52,"./utils":53,"component-emitter":8,"fast-safe-stringify":19,"qs":41}],51:[function(require,module,exports){
2791
2957
  const {
2792
2958
  isObject,
2793
2959
  hasOwn
@@ -3126,7 +3292,7 @@ RequestBase.prototype._setTimeouts = function () {
3126
3292
  }
3127
3293
  };
3128
3294
 
3129
- },{"./utils":36}],35:[function(require,module,exports){
3295
+ },{"./utils":53}],52:[function(require,module,exports){
3130
3296
  const utils = require('./utils');
3131
3297
  module.exports = ResponseBase;
3132
3298
  function ResponseBase() {}
@@ -3169,7 +3335,7 @@ ResponseBase.prototype._setStatusProperties = function (status) {
3169
3335
  this.unprocessableEntity = status === 422;
3170
3336
  };
3171
3337
 
3172
- },{"./utils":36}],36:[function(require,module,exports){
3338
+ },{"./utils":53}],53:[function(require,module,exports){
3173
3339
  exports.type = string_ => string_.split(/ *; */).shift();
3174
3340
  exports.params = value => {
3175
3341
  const object = {};
@@ -3202,6 +3368,10 @@ exports.cleanHeader = (header, changesOrigin) => {
3202
3368
  }
3203
3369
  return header;
3204
3370
  };
3371
+ exports.normalizeHostname = hostname => {
3372
+ const [, normalized] = hostname.match(/^\[([^\]]+)\]$/) || [];
3373
+ return normalized || hostname;
3374
+ };
3205
3375
  exports.isObject = object => {
3206
3376
  return object !== null && typeof object === 'object';
3207
3377
  };
@@ -3225,5 +3395,5 @@ exports.isBrotliEncoding = res => {
3225
3395
  return new RegExp(/^\s*(?:br)\s*$/).test(res.headers['content-encoding']);
3226
3396
  };
3227
3397
 
3228
- },{}]},{},[33])(33)
3398
+ },{}]},{},[50])(50)
3229
3399
  });