@andersbakken/fisk 4.0.65 → 4.0.66

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.
@@ -7708,7 +7708,7 @@ function push(dest, name, elem) {
7708
7708
  * @return {Object} The parsed object
7709
7709
  * @public
7710
7710
  */
7711
- function parse$a(header) {
7711
+ function parse$b(header) {
7712
7712
  const offers = Object.create(null);
7713
7713
 
7714
7714
  if (header === undefined || header === '') return offers;
@@ -7859,7 +7859,7 @@ function parse$a(header) {
7859
7859
  * @return {String} A string representing the given object
7860
7860
  * @public
7861
7861
  */
7862
- function format$3(extensions) {
7862
+ function format$4(extensions) {
7863
7863
  return Object.keys(extensions)
7864
7864
  .map((extension) => {
7865
7865
  let configurations = extensions[extension];
@@ -7883,7 +7883,7 @@ function format$3(extensions) {
7883
7883
  .join(', ');
7884
7884
  }
7885
7885
 
7886
- var extension = { format: format$3, parse: parse$a };
7886
+ var extension = { format: format$4, parse: parse$b };
7887
7887
 
7888
7888
  /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Readable$" }] */
7889
7889
 
@@ -7907,7 +7907,7 @@ const {
7907
7907
  NOOP
7908
7908
  } = constants;
7909
7909
  const { addEventListener, removeEventListener } = eventTarget;
7910
- const { format: format$2, parse: parse$9 } = extension;
7910
+ const { format: format$3, parse: parse$a } = extension;
7911
7911
  const { toBuffer } = bufferUtilExports;
7912
7912
 
7913
7913
  const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
@@ -8541,7 +8541,7 @@ function initAsClient(websocket, address, protocols, options) {
8541
8541
  false,
8542
8542
  opts.maxPayload
8543
8543
  );
8544
- opts.headers['Sec-WebSocket-Extensions'] = format$2({
8544
+ opts.headers['Sec-WebSocket-Extensions'] = format$3({
8545
8545
  [PerMessageDeflate$1.extensionName]: perMessageDeflate.offer()
8546
8546
  });
8547
8547
  }
@@ -8732,7 +8732,7 @@ function initAsClient(websocket, address, protocols, options) {
8732
8732
  let extensions;
8733
8733
 
8734
8734
  try {
8735
- extensions = parse$9(secWebSocketExtensions);
8735
+ extensions = parse$a(secWebSocketExtensions);
8736
8736
  } catch (err) {
8737
8737
  const message = 'Invalid Sec-WebSocket-Extensions header';
8738
8738
  abortHandshake$1(websocket, socket, message);
@@ -9267,7 +9267,7 @@ const { createHash } = crypto__default["default"];
9267
9267
 
9268
9268
  const PerMessageDeflate = permessageDeflate;
9269
9269
  const WebSocket$1 = websocket;
9270
- const { format: format$1, parse: parse$8 } = extension;
9270
+ const { format: format$2, parse: parse$9 } = extension;
9271
9271
  const { GUID, kWebSocket } = constants;
9272
9272
 
9273
9273
  const keyRegex = /^[+/0-9A-Za-z]{22}==$/;
@@ -9490,7 +9490,7 @@ class WebSocketServer extends EventEmitter {
9490
9490
  );
9491
9491
 
9492
9492
  try {
9493
- const offers = parse$8(req.headers['sec-websocket-extensions']);
9493
+ const offers = parse$9(req.headers['sec-websocket-extensions']);
9494
9494
 
9495
9495
  if (offers[PerMessageDeflate.extensionName]) {
9496
9496
  perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);
@@ -9591,7 +9591,7 @@ class WebSocketServer extends EventEmitter {
9591
9591
 
9592
9592
  if (extensions[PerMessageDeflate.extensionName]) {
9593
9593
  const params = extensions[PerMessageDeflate.extensionName].params;
9594
- const value = format$1({
9594
+ const value = format$2({
9595
9595
  [PerMessageDeflate.extensionName]: [params]
9596
9596
  });
9597
9597
  headers.push(`Sec-WebSocket-Extensions: ${value}`);
@@ -10258,10 +10258,10 @@ function DeprecationError (namespace, message, stack) {
10258
10258
  return error
10259
10259
  }
10260
10260
 
10261
- var bytesExports$1 = {};
10261
+ var bytesExports = {};
10262
10262
  var bytes$1 = {
10263
- get exports(){ return bytesExports$1; },
10264
- set exports(v){ bytesExports$1 = v; },
10263
+ get exports(){ return bytesExports; },
10264
+ set exports(v){ bytesExports = v; },
10265
10265
  };
10266
10266
 
10267
10267
  /*!
@@ -10271,174 +10271,166 @@ var bytes$1 = {
10271
10271
  * MIT Licensed
10272
10272
  */
10273
10273
 
10274
- var hasRequiredBytes;
10275
-
10276
- function requireBytes () {
10277
- if (hasRequiredBytes) return bytesExports$1;
10278
- hasRequiredBytes = 1;
10279
-
10280
- /**
10281
- * Module exports.
10282
- * @public
10283
- */
10274
+ /**
10275
+ * Module exports.
10276
+ * @public
10277
+ */
10284
10278
 
10285
- bytes$1.exports = bytes;
10286
- bytesExports$1.format = format;
10287
- bytesExports$1.parse = parse;
10279
+ bytes$1.exports = bytes;
10280
+ bytesExports.format = format$1;
10281
+ bytesExports.parse = parse$8;
10288
10282
 
10289
- /**
10290
- * Module variables.
10291
- * @private
10292
- */
10283
+ /**
10284
+ * Module variables.
10285
+ * @private
10286
+ */
10293
10287
 
10294
- var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
10288
+ var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
10295
10289
 
10296
- var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
10290
+ var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
10297
10291
 
10298
- var map = {
10299
- b: 1,
10300
- kb: 1 << 10,
10301
- mb: 1 << 20,
10302
- gb: 1 << 30,
10303
- tb: Math.pow(1024, 4),
10304
- pb: Math.pow(1024, 5),
10305
- };
10292
+ var map = {
10293
+ b: 1,
10294
+ kb: 1 << 10,
10295
+ mb: 1 << 20,
10296
+ gb: 1 << 30,
10297
+ tb: Math.pow(1024, 4),
10298
+ pb: Math.pow(1024, 5),
10299
+ };
10306
10300
 
10307
- var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
10301
+ var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
10308
10302
 
10309
- /**
10310
- * Convert the given value in bytes into a string or parse to string to an integer in bytes.
10311
- *
10312
- * @param {string|number} value
10313
- * @param {{
10314
- * case: [string],
10315
- * decimalPlaces: [number]
10316
- * fixedDecimals: [boolean]
10317
- * thousandsSeparator: [string]
10318
- * unitSeparator: [string]
10319
- * }} [options] bytes options.
10320
- *
10321
- * @returns {string|number|null}
10322
- */
10303
+ /**
10304
+ * Convert the given value in bytes into a string or parse to string to an integer in bytes.
10305
+ *
10306
+ * @param {string|number} value
10307
+ * @param {{
10308
+ * case: [string],
10309
+ * decimalPlaces: [number]
10310
+ * fixedDecimals: [boolean]
10311
+ * thousandsSeparator: [string]
10312
+ * unitSeparator: [string]
10313
+ * }} [options] bytes options.
10314
+ *
10315
+ * @returns {string|number|null}
10316
+ */
10323
10317
 
10324
- function bytes(value, options) {
10325
- if (typeof value === 'string') {
10326
- return parse(value);
10327
- }
10318
+ function bytes(value, options) {
10319
+ if (typeof value === 'string') {
10320
+ return parse$8(value);
10321
+ }
10328
10322
 
10329
- if (typeof value === 'number') {
10330
- return format(value, options);
10331
- }
10323
+ if (typeof value === 'number') {
10324
+ return format$1(value, options);
10325
+ }
10332
10326
 
10333
- return null;
10334
- }
10327
+ return null;
10328
+ }
10335
10329
 
10336
- /**
10337
- * Format the given value in bytes into a string.
10338
- *
10339
- * If the value is negative, it is kept as such. If it is a float,
10340
- * it is rounded.
10341
- *
10342
- * @param {number} value
10343
- * @param {object} [options]
10344
- * @param {number} [options.decimalPlaces=2]
10345
- * @param {number} [options.fixedDecimals=false]
10346
- * @param {string} [options.thousandsSeparator=]
10347
- * @param {string} [options.unit=]
10348
- * @param {string} [options.unitSeparator=]
10349
- *
10350
- * @returns {string|null}
10351
- * @public
10352
- */
10330
+ /**
10331
+ * Format the given value in bytes into a string.
10332
+ *
10333
+ * If the value is negative, it is kept as such. If it is a float,
10334
+ * it is rounded.
10335
+ *
10336
+ * @param {number} value
10337
+ * @param {object} [options]
10338
+ * @param {number} [options.decimalPlaces=2]
10339
+ * @param {number} [options.fixedDecimals=false]
10340
+ * @param {string} [options.thousandsSeparator=]
10341
+ * @param {string} [options.unit=]
10342
+ * @param {string} [options.unitSeparator=]
10343
+ *
10344
+ * @returns {string|null}
10345
+ * @public
10346
+ */
10353
10347
 
10354
- function format(value, options) {
10355
- if (!Number.isFinite(value)) {
10356
- return null;
10357
- }
10348
+ function format$1(value, options) {
10349
+ if (!Number.isFinite(value)) {
10350
+ return null;
10351
+ }
10358
10352
 
10359
- var mag = Math.abs(value);
10360
- var thousandsSeparator = (options && options.thousandsSeparator) || '';
10361
- var unitSeparator = (options && options.unitSeparator) || '';
10362
- var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2;
10363
- var fixedDecimals = Boolean(options && options.fixedDecimals);
10364
- var unit = (options && options.unit) || '';
10365
-
10366
- if (!unit || !map[unit.toLowerCase()]) {
10367
- if (mag >= map.pb) {
10368
- unit = 'PB';
10369
- } else if (mag >= map.tb) {
10370
- unit = 'TB';
10371
- } else if (mag >= map.gb) {
10372
- unit = 'GB';
10373
- } else if (mag >= map.mb) {
10374
- unit = 'MB';
10375
- } else if (mag >= map.kb) {
10376
- unit = 'KB';
10377
- } else {
10378
- unit = 'B';
10379
- }
10380
- }
10353
+ var mag = Math.abs(value);
10354
+ var thousandsSeparator = (options && options.thousandsSeparator) || '';
10355
+ var unitSeparator = (options && options.unitSeparator) || '';
10356
+ var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2;
10357
+ var fixedDecimals = Boolean(options && options.fixedDecimals);
10358
+ var unit = (options && options.unit) || '';
10359
+
10360
+ if (!unit || !map[unit.toLowerCase()]) {
10361
+ if (mag >= map.pb) {
10362
+ unit = 'PB';
10363
+ } else if (mag >= map.tb) {
10364
+ unit = 'TB';
10365
+ } else if (mag >= map.gb) {
10366
+ unit = 'GB';
10367
+ } else if (mag >= map.mb) {
10368
+ unit = 'MB';
10369
+ } else if (mag >= map.kb) {
10370
+ unit = 'KB';
10371
+ } else {
10372
+ unit = 'B';
10373
+ }
10374
+ }
10381
10375
 
10382
- var val = value / map[unit.toLowerCase()];
10383
- var str = val.toFixed(decimalPlaces);
10376
+ var val = value / map[unit.toLowerCase()];
10377
+ var str = val.toFixed(decimalPlaces);
10384
10378
 
10385
- if (!fixedDecimals) {
10386
- str = str.replace(formatDecimalsRegExp, '$1');
10387
- }
10379
+ if (!fixedDecimals) {
10380
+ str = str.replace(formatDecimalsRegExp, '$1');
10381
+ }
10388
10382
 
10389
- if (thousandsSeparator) {
10390
- str = str.split('.').map(function (s, i) {
10391
- return i === 0
10392
- ? s.replace(formatThousandsRegExp, thousandsSeparator)
10393
- : s
10394
- }).join('.');
10395
- }
10383
+ if (thousandsSeparator) {
10384
+ str = str.split('.').map(function (s, i) {
10385
+ return i === 0
10386
+ ? s.replace(formatThousandsRegExp, thousandsSeparator)
10387
+ : s
10388
+ }).join('.');
10389
+ }
10396
10390
 
10397
- return str + unitSeparator + unit;
10398
- }
10391
+ return str + unitSeparator + unit;
10392
+ }
10399
10393
 
10400
- /**
10401
- * Parse the string value into an integer in bytes.
10402
- *
10403
- * If no unit is given, it is assumed the value is in bytes.
10404
- *
10405
- * @param {number|string} val
10406
- *
10407
- * @returns {number|null}
10408
- * @public
10409
- */
10394
+ /**
10395
+ * Parse the string value into an integer in bytes.
10396
+ *
10397
+ * If no unit is given, it is assumed the value is in bytes.
10398
+ *
10399
+ * @param {number|string} val
10400
+ *
10401
+ * @returns {number|null}
10402
+ * @public
10403
+ */
10410
10404
 
10411
- function parse(val) {
10412
- if (typeof val === 'number' && !isNaN(val)) {
10413
- return val;
10414
- }
10405
+ function parse$8(val) {
10406
+ if (typeof val === 'number' && !isNaN(val)) {
10407
+ return val;
10408
+ }
10415
10409
 
10416
- if (typeof val !== 'string') {
10417
- return null;
10418
- }
10410
+ if (typeof val !== 'string') {
10411
+ return null;
10412
+ }
10419
10413
 
10420
- // Test if the string passed is valid
10421
- var results = parseRegExp.exec(val);
10422
- var floatValue;
10423
- var unit = 'b';
10414
+ // Test if the string passed is valid
10415
+ var results = parseRegExp.exec(val);
10416
+ var floatValue;
10417
+ var unit = 'b';
10424
10418
 
10425
- if (!results) {
10426
- // Nothing could be extracted from the given string
10427
- floatValue = parseInt(val, 10);
10428
- unit = 'b';
10429
- } else {
10430
- // Retrieve the value and the unit
10431
- floatValue = parseFloat(results[1]);
10432
- unit = results[4].toLowerCase();
10433
- }
10419
+ if (!results) {
10420
+ // Nothing could be extracted from the given string
10421
+ floatValue = parseInt(val, 10);
10422
+ unit = 'b';
10423
+ } else {
10424
+ // Retrieve the value and the unit
10425
+ floatValue = parseFloat(results[1]);
10426
+ unit = results[4].toLowerCase();
10427
+ }
10434
10428
 
10435
- if (isNaN(floatValue)) {
10436
- return null;
10437
- }
10429
+ if (isNaN(floatValue)) {
10430
+ return null;
10431
+ }
10438
10432
 
10439
- return Math.floor(map[unit] * floatValue);
10440
- }
10441
- return bytesExports$1;
10433
+ return Math.floor(map[unit] * floatValue);
10442
10434
  }
10443
10435
 
10444
10436
  var contentType = {};
@@ -23608,7 +23600,7 @@ function requireRawBody () {
23608
23600
  */
23609
23601
 
23610
23602
  var asyncHooks = tryRequireAsyncHooks();
23611
- var bytes = requireBytes();
23603
+ var bytes = bytesExports;
23612
23604
  var createError = requireHttpErrors();
23613
23605
  var iconv = requireLib$1();
23614
23606
  var unpipe = requireUnpipe();
@@ -35986,7 +35978,7 @@ function requireJson () {
35986
35978
  * @private
35987
35979
  */
35988
35980
 
35989
- var bytes = requireBytes();
35981
+ var bytes = bytesExports;
35990
35982
  var contentType = requireContentType();
35991
35983
  var createError = requireHttpErrors();
35992
35984
  var debug = requireSrc()('body-parser:json');
@@ -36132,7 +36124,11 @@ function requireJson () {
36132
36124
  var partial = '';
36133
36125
 
36134
36126
  if (index !== -1) {
36135
- partial = str.substring(0, index) + new Array(str.length - index + 1).join(JSON_SYNTAX_CHAR);
36127
+ partial = str.substring(0, index) + JSON_SYNTAX_CHAR;
36128
+
36129
+ for (var i = index + 1; i < str.length; i++) {
36130
+ partial += JSON_SYNTAX_CHAR;
36131
+ }
36136
36132
  }
36137
36133
 
36138
36134
  try {
@@ -36235,7 +36231,7 @@ function requireRaw () {
36235
36231
  * Module dependencies.
36236
36232
  */
36237
36233
 
36238
- var bytes = requireBytes();
36234
+ var bytes = bytesExports;
36239
36235
  var debug = requireSrc()('body-parser:raw');
36240
36236
  var read = requireRead();
36241
36237
  var typeis = requireTypeIs();
@@ -36344,7 +36340,7 @@ function requireText () {
36344
36340
  * Module dependencies.
36345
36341
  */
36346
36342
 
36347
- var bytes = requireBytes();
36343
+ var bytes = bytesExports;
36348
36344
  var contentType = requireContentType();
36349
36345
  var debug = requireSrc()('body-parser:text');
36350
36346
  var read = requireRead();
@@ -38470,7 +38466,7 @@ function requireUtils () {
38470
38466
  var hexTable = (function () {
38471
38467
  var array = [];
38472
38468
  for (var i = 0; i < 256; ++i) {
38473
- array[array.length] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();
38469
+ array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
38474
38470
  }
38475
38471
 
38476
38472
  return array;
@@ -38486,7 +38482,7 @@ function requireUtils () {
38486
38482
 
38487
38483
  for (var j = 0; j < obj.length; ++j) {
38488
38484
  if (typeof obj[j] !== 'undefined') {
38489
- compacted[compacted.length] = obj[j];
38485
+ compacted.push(obj[j]);
38490
38486
  }
38491
38487
  }
38492
38488
 
@@ -38514,19 +38510,13 @@ function requireUtils () {
38514
38510
 
38515
38511
  if (typeof source !== 'object' && typeof source !== 'function') {
38516
38512
  if (isArray(target)) {
38517
- var nextIndex = target.length;
38518
- if (options && typeof options.arrayLimit === 'number' && nextIndex > options.arrayLimit) {
38519
- return markOverflow(arrayToObject(target.concat(source), options), nextIndex);
38520
- }
38521
- target[nextIndex] = source;
38513
+ target.push(source);
38522
38514
  } else if (target && typeof target === 'object') {
38523
38515
  if (isOverflow(target)) {
38524
38516
  // Add at next numeric index for overflow objects
38525
38517
  var newIndex = getMaxIndex(target) + 1;
38526
38518
  target[newIndex] = source;
38527
38519
  setMaxIndex(target, newIndex);
38528
- } else if (options && options.strictMerge) {
38529
- return [target, source];
38530
38520
  } else if (
38531
38521
  (options && (options.plainObjects || options.allowPrototypes))
38532
38522
  || !has.call(Object.prototype, source)
@@ -38553,11 +38543,7 @@ function requireUtils () {
38553
38543
  }
38554
38544
  return markOverflow(result, getMaxIndex(source) + 1);
38555
38545
  }
38556
- var combined = [target].concat(source);
38557
- if (options && typeof options.arrayLimit === 'number' && combined.length > options.arrayLimit) {
38558
- return markOverflow(arrayToObject(combined, options), combined.length - 1);
38559
- }
38560
- return combined;
38546
+ return [target].concat(source);
38561
38547
  }
38562
38548
 
38563
38549
  var mergeTarget = target;
@@ -38572,7 +38558,7 @@ function requireUtils () {
38572
38558
  if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
38573
38559
  target[i] = merge(targetItem, item, options);
38574
38560
  } else {
38575
- target[target.length] = item;
38561
+ target.push(item);
38576
38562
  }
38577
38563
  } else {
38578
38564
  target[i] = item;
@@ -38589,17 +38575,6 @@ function requireUtils () {
38589
38575
  } else {
38590
38576
  acc[key] = value;
38591
38577
  }
38592
-
38593
- if (isOverflow(source) && !isOverflow(acc)) {
38594
- markOverflow(acc, getMaxIndex(source));
38595
- }
38596
- if (isOverflow(acc)) {
38597
- var keyNum = parseInt(key, 10);
38598
- if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) {
38599
- setMaxIndex(acc, keyNum);
38600
- }
38601
- }
38602
-
38603
38578
  return acc;
38604
38579
  }, mergeTarget);
38605
38580
  };
@@ -38716,8 +38691,8 @@ function requireUtils () {
38716
38691
  var key = keys[j];
38717
38692
  var val = obj[key];
38718
38693
  if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
38719
- queue[queue.length] = { obj: obj, prop: key };
38720
- refs[refs.length] = val;
38694
+ queue.push({ obj: obj, prop: key });
38695
+ refs.push(val);
38721
38696
  }
38722
38697
  }
38723
38698
  }
@@ -38759,7 +38734,7 @@ function requireUtils () {
38759
38734
  if (isArray(val)) {
38760
38735
  var mapped = [];
38761
38736
  for (var i = 0; i < val.length; i += 1) {
38762
- mapped[mapped.length] = fn(val[i]);
38737
+ mapped.push(fn(val[i]));
38763
38738
  }
38764
38739
  return mapped;
38765
38740
  }
@@ -38776,7 +38751,6 @@ function requireUtils () {
38776
38751
  isBuffer: isBuffer,
38777
38752
  isOverflow: isOverflow,
38778
38753
  isRegExp: isRegExp,
38779
- markOverflow: markOverflow,
38780
38754
  maybeMap: maybeMap,
38781
38755
  merge: merge
38782
38756
  };
@@ -38908,7 +38882,7 @@ function requireStringify () {
38908
38882
 
38909
38883
  if (obj === null) {
38910
38884
  if (strictNullHandling) {
38911
- return formatter(encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix);
38885
+ return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;
38912
38886
  }
38913
38887
 
38914
38888
  obj = '';
@@ -38932,9 +38906,7 @@ function requireStringify () {
38932
38906
  if (generateArrayPrefix === 'comma' && isArray(obj)) {
38933
38907
  // we need to join elements in
38934
38908
  if (encodeValuesOnly && encoder) {
38935
- obj = utils.maybeMap(obj, function (v) {
38936
- return v == null ? v : encoder(v);
38937
- });
38909
+ obj = utils.maybeMap(obj, encoder);
38938
38910
  }
38939
38911
  objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
38940
38912
  } else if (isArray(filter)) {
@@ -39104,11 +39076,6 @@ function requireStringify () {
39104
39076
  var sideChannel = getSideChannel();
39105
39077
  for (var i = 0; i < objKeys.length; ++i) {
39106
39078
  var key = objKeys[i];
39107
-
39108
- if (typeof key === 'undefined' || key === null) {
39109
- continue;
39110
- }
39111
-
39112
39079
  var value = obj[key];
39113
39080
 
39114
39081
  if (options.skipNulls && value === null) {
@@ -39142,10 +39109,10 @@ function requireStringify () {
39142
39109
  if (options.charsetSentinel) {
39143
39110
  if (options.charset === 'iso-8859-1') {
39144
39111
  // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
39145
- prefix += 'utf8=%26%2310003%3B' + options.delimiter;
39112
+ prefix += 'utf8=%26%2310003%3B&';
39146
39113
  } else {
39147
39114
  // encodeURIComponent('✓')
39148
- prefix += 'utf8=%E2%9C%93' + options.delimiter;
39115
+ prefix += 'utf8=%E2%9C%93&';
39149
39116
  }
39150
39117
  }
39151
39118
 
@@ -39186,7 +39153,6 @@ function requireParse () {
39186
39153
  parseArrays: true,
39187
39154
  plainObjects: false,
39188
39155
  strictDepth: false,
39189
- strictMerge: true,
39190
39156
  strictNullHandling: false,
39191
39157
  throwOnLimitExceeded: false
39192
39158
  };
@@ -39225,13 +39191,13 @@ function requireParse () {
39225
39191
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
39226
39192
  cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
39227
39193
 
39228
- var limit = options.parameterLimit === Infinity ? void undefined : options.parameterLimit;
39194
+ var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
39229
39195
  var parts = cleanStr.split(
39230
39196
  options.delimiter,
39231
- options.throwOnLimitExceeded && typeof limit !== 'undefined' ? limit + 1 : limit
39197
+ options.throwOnLimitExceeded ? limit + 1 : limit
39232
39198
  );
39233
39199
 
39234
- if (options.throwOnLimitExceeded && typeof limit !== 'undefined' && parts.length > limit) {
39200
+ if (options.throwOnLimitExceeded && parts.length > limit) {
39235
39201
  throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');
39236
39202
  }
39237
39203
 
@@ -39292,16 +39258,9 @@ function requireParse () {
39292
39258
  val = isArray(val) ? [val] : val;
39293
39259
  }
39294
39260
 
39295
- if (options.comma && isArray(val) && val.length > options.arrayLimit) {
39296
- if (options.throwOnLimitExceeded) {
39297
- throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
39298
- }
39299
- val = utils.combine([], val, options.arrayLimit, options.plainObjects);
39300
- }
39301
-
39302
39261
  if (key !== null) {
39303
39262
  var existing = has.call(obj, key);
39304
- if (existing && (options.duplicates === 'combine' || part.indexOf('[]=') > -1)) {
39263
+ if (existing && options.duplicates === 'combine') {
39305
39264
  obj[key] = utils.combine(
39306
39265
  obj[key],
39307
39266
  val,
@@ -39349,21 +39308,17 @@ function requireParse () {
39349
39308
  var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
39350
39309
  var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
39351
39310
  var index = parseInt(decodedRoot, 10);
39352
- var isValidArrayIndex = !isNaN(index)
39311
+ if (!options.parseArrays && decodedRoot === '') {
39312
+ obj = { 0: leaf };
39313
+ } else if (
39314
+ !isNaN(index)
39353
39315
  && root !== decodedRoot
39354
39316
  && String(index) === decodedRoot
39355
39317
  && index >= 0
39356
- && options.parseArrays;
39357
- if (!options.parseArrays && decodedRoot === '') {
39358
- obj = { 0: leaf };
39359
- } else if (isValidArrayIndex && index < options.arrayLimit) {
39318
+ && (options.parseArrays && index <= options.arrayLimit)
39319
+ ) {
39360
39320
  obj = [];
39361
39321
  obj[index] = leaf;
39362
- } else if (isValidArrayIndex && options.throwOnLimitExceeded) {
39363
- throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
39364
- } else if (isValidArrayIndex) {
39365
- obj[index] = leaf;
39366
- utils.markOverflow(obj, index);
39367
39322
  } else if (decodedRoot !== '__proto__') {
39368
39323
  obj[decodedRoot] = leaf;
39369
39324
  }
@@ -39375,12 +39330,9 @@ function requireParse () {
39375
39330
  return leaf;
39376
39331
  };
39377
39332
 
39378
- // Split a key like "a[b][c[]]" into ['a', '[b]', '[c[]]'] while preserving
39379
- // qs parse semantics for depth/prototype guards.
39380
- var splitKeyIntoSegments = function splitKeyIntoSegments(originalKey, options) {
39381
- var key = options.allowDots ? originalKey.replace(/\.([^.[]+)/g, '[$1]') : originalKey;
39333
+ var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) {
39334
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
39382
39335
 
39383
- // depth <= 0 keeps the whole key as one segment
39384
39336
  if (options.depth <= 0) {
39385
39337
  if (!options.plainObjects && has.call(Object.prototype, key)) {
39386
39338
  if (!options.allowPrototypes) {
@@ -39391,11 +39343,14 @@ function requireParse () {
39391
39343
  return [key];
39392
39344
  }
39393
39345
 
39394
- var segments = [];
39346
+ var brackets = /(\[[^[\]]*])/;
39347
+ var child = /(\[[^[\]]*])/g;
39348
+
39349
+ var segment = brackets.exec(key);
39350
+ var parent = segment ? key.slice(0, segment.index) : key;
39351
+
39352
+ var keys = [];
39395
39353
 
39396
- // parent before the first '[' (may be empty if key starts with '[')
39397
- var first = key.indexOf('[');
39398
- var parent = first >= 0 ? key.slice(0, first) : key;
39399
39354
  if (parent) {
39400
39355
  if (!options.plainObjects && has.call(Object.prototype, parent)) {
39401
39356
  if (!options.allowPrototypes) {
@@ -39403,62 +39358,32 @@ function requireParse () {
39403
39358
  }
39404
39359
  }
39405
39360
 
39406
- segments[segments.length] = parent;
39361
+ keys.push(parent);
39407
39362
  }
39408
39363
 
39409
- var n = key.length;
39410
- var open = first;
39411
- var collected = 0;
39412
-
39413
- while (open >= 0 && collected < options.depth) {
39414
- var level = 1;
39415
- var i = open + 1;
39416
- var close = -1;
39364
+ var i = 0;
39365
+ while ((segment = child.exec(key)) !== null && i < options.depth) {
39366
+ i += 1;
39417
39367
 
39418
- // balance nested '[' and ']' inside this bracket group using a nesting level counter
39419
- while (i < n && close < 0) {
39420
- var cu = key.charCodeAt(i);
39421
- if (cu === 0x5B) { // '['
39422
- level += 1;
39423
- } else if (cu === 0x5D) { // ']'
39424
- level -= 1;
39425
- if (level === 0) {
39426
- close = i; // found matching close; loop will exit by condition
39427
- }
39368
+ var segmentContent = segment[1].slice(1, -1);
39369
+ if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
39370
+ if (!options.allowPrototypes) {
39371
+ return;
39428
39372
  }
39429
- i += 1;
39430
- }
39431
-
39432
- if (close < 0) {
39433
- // Unterminated group: wrap the raw remainder in one bracket pair so it stays
39434
- // a single literal segment (e.g. "[[]b" -> "[[]b]"); we do not infer missing ']'.
39435
- segments[segments.length] = '[' + key.slice(open) + ']';
39436
- return segments;
39437
39373
  }
39438
39374
 
39439
- var seg = key.slice(open, close + 1);
39440
- // prototype guard for the content of this group
39441
- var content = seg.slice(1, -1);
39442
- if (!options.plainObjects && has.call(Object.prototype, content) && !options.allowPrototypes) {
39443
- return;
39444
- }
39445
-
39446
- segments[segments.length] = seg;
39447
- collected += 1;
39448
-
39449
- // find the next '[' after this balanced group
39450
- open = key.indexOf('[', close + 1);
39375
+ keys.push(segment[1]);
39451
39376
  }
39452
39377
 
39453
- if (open >= 0) {
39378
+ if (segment) {
39454
39379
  if (options.strictDepth === true) {
39455
39380
  throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
39456
39381
  }
39457
39382
 
39458
- segments[segments.length] = '[' + key.slice(open) + ']';
39383
+ keys.push('[' + key.slice(segment.index) + ']');
39459
39384
  }
39460
39385
 
39461
- return segments;
39386
+ return keys;
39462
39387
  };
39463
39388
 
39464
39389
  var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
@@ -39531,7 +39456,6 @@ function requireParse () {
39531
39456
  parseArrays: opts.parseArrays !== false,
39532
39457
  plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
39533
39458
  strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,
39534
- strictMerge: typeof opts.strictMerge === 'boolean' ? !!opts.strictMerge : defaults.strictMerge,
39535
39459
  strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,
39536
39460
  throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false
39537
39461
  };
@@ -39603,7 +39527,7 @@ function requireUrlencoded () {
39603
39527
  * @private
39604
39528
  */
39605
39529
 
39606
- var bytes = requireBytes();
39530
+ var bytes = bytesExports;
39607
39531
  var contentType = requireContentType();
39608
39532
  var createError = requireHttpErrors();
39609
39533
  var debug = requireSrc()('body-parser:urlencoded');
@@ -39797,15 +39721,16 @@ function requireUrlencoded () {
39797
39721
 
39798
39722
  function parameterCount (body, limit) {
39799
39723
  var count = 0;
39800
- var index = -1;
39724
+ var index = 0;
39801
39725
 
39802
- do {
39726
+ while ((index = body.indexOf('&', index)) !== -1) {
39803
39727
  count++;
39804
- if (count > limit) {
39728
+ index++;
39729
+
39730
+ if (count === limit) {
39805
39731
  return undefined
39806
39732
  }
39807
- index = body.indexOf('&', index + 1);
39808
- } while (index !== -1)
39733
+ }
39809
39734
 
39810
39735
  return count
39811
39736
  }
@@ -42654,7 +42579,6 @@ function pathToRegexp(path, keys, options) {
42654
42579
  pos = offset + match.length;
42655
42580
 
42656
42581
  if (match === '*') {
42657
- backtrack = '';
42658
42582
  extraOffset += 3;
42659
42583
  return '(.*)';
42660
42584
  }
@@ -42684,7 +42608,6 @@ function pathToRegexp(path, keys, options) {
42684
42608
  + ')'
42685
42609
  + optional;
42686
42610
 
42687
- backtrack = '';
42688
42611
  extraOffset += result.length - match.length;
42689
42612
 
42690
42613
  return result;
@@ -51568,8 +51491,7 @@ function trustSingle (subnet) {
51568
51491
 
51569
51492
  function parseExtendedQueryString(str) {
51570
51493
  return qs.parse(str, {
51571
- allowPrototypes: true,
51572
- arrayLimit: 1000
51494
+ allowPrototypes: true
51573
51495
  });
51574
51496
  }
51575
51497
 
@@ -56482,9 +56404,6 @@ function common$1(option) {
56482
56404
  };
56483
56405
  }
56484
56406
 
56485
- var bytesExports = requireBytes();
56486
- var bytes = /*@__PURE__*/getDefaultExportFromCjs(bytesExports);
56487
-
56488
56407
  var compareVersionsExports = {};
56489
56408
  var compareVersions$1 = {
56490
56409
  get exports(){ return compareVersionsExports; },
@@ -58261,7 +58180,7 @@ function purgeEnvironmentsToMaxSize() {
58261
58180
  return new Promise((resolve) => {
58262
58181
  let max = option("max-environment-size");
58263
58182
  if (typeof max === "string") {
58264
- max = bytes.parse(max);
58183
+ max = bytesExports.parse(max);
58265
58184
  }
58266
58185
  else if (typeof max !== "number") {
58267
58186
  max = 0;
@@ -58367,7 +58286,7 @@ function environmentsInfo() {
58367
58286
  const ret = Object.assign({}, Environments.instance.environments);
58368
58287
  ret.maxSize = option("max-environment-size") || 0;
58369
58288
  const max = option("max-environment-size");
58370
- ret.maxSizeBytes = max ? bytes.parse(String(max)) || 0 : 0;
58289
+ ret.maxSizeBytes = max ? bytesExports.parse(String(max)) || 0 : 0;
58371
58290
  let usedSizeBytes = 0;
58372
58291
  for (const hsh in Environments.instance.environments) {
58373
58292
  const env = Environments.instance.environments[hsh];
@@ -58375,7 +58294,7 @@ function environmentsInfo() {
58375
58294
  usedSizeBytes += env.size;
58376
58295
  }
58377
58296
  }
58378
- ret.usedSize = bytes.format(usedSizeBytes);
58297
+ ret.usedSize = bytesExports.format(usedSizeBytes);
58379
58298
  ret.links = Environments.instance.linksInfo();
58380
58299
  ret.usedSizeBytes = usedSizeBytes;
58381
58300
  return ret;