@mtes-mct/monitor-ui 10.9.2 → 10.9.3

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/index.js CHANGED
@@ -12,31 +12,6 @@ function getDefaultExportFromCjs (x) {
12
12
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
13
13
  }
14
14
 
15
- function getAugmentedNamespace(n) {
16
- if (n.__esModule) return n;
17
- var f = n.default;
18
- if (typeof f == "function") {
19
- var a = function a () {
20
- if (this instanceof a) {
21
- return Reflect.construct(f, arguments, this.constructor);
22
- }
23
- return f.apply(this, arguments);
24
- };
25
- a.prototype = f.prototype;
26
- } else a = {};
27
- Object.defineProperty(a, '__esModule', {value: true});
28
- Object.keys(n).forEach(function (k) {
29
- var d = Object.getOwnPropertyDescriptor(n, k);
30
- Object.defineProperty(a, k, d.get ? d : {
31
- enumerable: true,
32
- get: function () {
33
- return n[k];
34
- }
35
- });
36
- });
37
- return a;
38
- }
39
-
40
15
  var isSameOrAfter$1 = {exports: {}};
41
16
 
42
17
  (function (module, exports) {
@@ -740,13 +715,13 @@ function _objectIs(a, b) {
740
715
 
741
716
  var _objectIs$1 = typeof Object.is === 'function' ? Object.is : _objectIs;
742
717
 
743
- var toString$3 = Object.prototype.toString;
718
+ var toString$2 = Object.prototype.toString;
744
719
 
745
720
  var _isArguments =
746
721
  /*#__PURE__*/
747
722
  function () {
748
- return toString$3.call(arguments) === '[object Arguments]' ? function _isArguments(x) {
749
- return toString$3.call(x) === '[object Arguments]';
723
+ return toString$2.call(arguments) === '[object Arguments]' ? function _isArguments(x) {
724
+ return toString$2.call(x) === '[object Arguments]';
750
725
  } : function _isArguments(x) {
751
726
  return _has('callee', x);
752
727
  };
@@ -799,7 +774,7 @@ var contains = function contains(list, item) {
799
774
  */
800
775
 
801
776
 
802
- var keys = typeof Object.keys === 'function' && !hasArgsEnumBug ?
777
+ var keys$1 = typeof Object.keys === 'function' && !hasArgsEnumBug ?
803
778
  /*#__PURE__*/
804
779
  _curry1(function keys(obj) {
805
780
  return Object(obj) !== obj ? [] : Object.keys(obj);
@@ -1003,9 +978,9 @@ function _equals(a, b, stackA, stackB) {
1003
978
  return false;
1004
979
  }
1005
980
 
1006
- var keysA = keys(a);
981
+ var keysA = keys$1(a);
1007
982
 
1008
- if (keysA.length !== keys(b).length) {
983
+ if (keysA.length !== keys$1(b).length) {
1009
984
  return false;
1010
985
  }
1011
986
 
@@ -1244,7 +1219,7 @@ _dispatchable(['fantasy-land/filter', 'filter'], _xfilter, function (pred, filte
1244
1219
  }
1245
1220
 
1246
1221
  return acc;
1247
- }, {}, keys(filterable)) : // else
1222
+ }, {}, keys$1(filterable)) : // else
1248
1223
  _filter(pred, filterable);
1249
1224
  }));
1250
1225
 
@@ -1354,7 +1329,7 @@ _dispatchable(['fantasy-land/map', 'map'], _xmap, function map(fn, functor) {
1354
1329
  return _arrayReduce(function (acc, key) {
1355
1330
  acc[key] = fn(functor[key]);
1356
1331
  return acc;
1357
- }, {}, keys(functor));
1332
+ }, {}, keys$1(functor));
1358
1333
 
1359
1334
  default:
1360
1335
  return _map(fn, functor);
@@ -1919,7 +1894,7 @@ function _isTypedArray(val) {
1919
1894
  * R.empty(Uint8Array.from('123')); //=> Uint8Array []
1920
1895
  */
1921
1896
 
1922
- var empty$2 =
1897
+ var empty =
1923
1898
  /*#__PURE__*/
1924
1899
  _curry1(function empty(x) {
1925
1900
  return x != null && typeof x['fantasy-land/empty'] === 'function' ? x['fantasy-land/empty']() : x != null && x.constructor != null && typeof x.constructor['fantasy-land/empty'] === 'function' ? x.constructor['fantasy-land/empty']() : x != null && typeof x.empty === 'function' ? x.empty() : x != null && x.constructor != null && typeof x.constructor.empty === 'function' ? x.constructor.empty() : _isArray(x) ? [] : _isString(x) ? '' : _isObject(x) ? {} : _isArguments(x) ? function () {
@@ -2012,7 +1987,7 @@ _curry2(_includes);
2012
1987
  var isEmpty =
2013
1988
  /*#__PURE__*/
2014
1989
  _curry1(function isEmpty(x) {
2015
- return x != null && equals$1(x, empty$2(x));
1990
+ return x != null && equals$1(x, empty(x));
2016
1991
  });
2017
1992
 
2018
1993
  /**
@@ -2358,7 +2333,7 @@ const Dialog = Object.assign(RawDialog, {
2358
2333
  Title: Title$1
2359
2334
  });
2360
2335
 
2361
- function Item$1({ accent, Icon, ...originalProps }) {
2336
+ function Item({ accent, Icon, ...originalProps }) {
2362
2337
  const icon = useMemo(()=>Icon ? /*#__PURE__*/ jsx(Icon, {
2363
2338
  size: 20
2364
2339
  }) : undefined, [
@@ -2516,237 +2491,9 @@ const SecondaryDropdown = styled(Dropdown$1)`
2516
2491
  `;
2517
2492
  RawDropdown.displayName = 'Dropdown';
2518
2493
  const Dropdown = Object.assign(RawDropdown, {
2519
- Item: Item$1
2494
+ Item
2520
2495
  });
2521
2496
 
2522
- var global$1 = (typeof global !== "undefined" ? global :
2523
- typeof self !== "undefined" ? self :
2524
- typeof window !== "undefined" ? window : {});
2525
-
2526
- // shim for using process in browser
2527
- // based off https://github.com/defunctzombie/node-process/blob/master/browser.js
2528
-
2529
- function defaultSetTimout() {
2530
- throw new Error('setTimeout has not been defined');
2531
- }
2532
- function defaultClearTimeout () {
2533
- throw new Error('clearTimeout has not been defined');
2534
- }
2535
- var cachedSetTimeout = defaultSetTimout;
2536
- var cachedClearTimeout = defaultClearTimeout;
2537
- if (typeof global$1.setTimeout === 'function') {
2538
- cachedSetTimeout = setTimeout;
2539
- }
2540
- if (typeof global$1.clearTimeout === 'function') {
2541
- cachedClearTimeout = clearTimeout;
2542
- }
2543
-
2544
- function runTimeout(fun) {
2545
- if (cachedSetTimeout === setTimeout) {
2546
- //normal enviroments in sane situations
2547
- return setTimeout(fun, 0);
2548
- }
2549
- // if setTimeout wasn't available but was latter defined
2550
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
2551
- cachedSetTimeout = setTimeout;
2552
- return setTimeout(fun, 0);
2553
- }
2554
- try {
2555
- // when when somebody has screwed with setTimeout but no I.E. maddness
2556
- return cachedSetTimeout(fun, 0);
2557
- } catch(e){
2558
- try {
2559
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
2560
- return cachedSetTimeout.call(null, fun, 0);
2561
- } catch(e){
2562
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
2563
- return cachedSetTimeout.call(this, fun, 0);
2564
- }
2565
- }
2566
-
2567
-
2568
- }
2569
- function runClearTimeout(marker) {
2570
- if (cachedClearTimeout === clearTimeout) {
2571
- //normal enviroments in sane situations
2572
- return clearTimeout(marker);
2573
- }
2574
- // if clearTimeout wasn't available but was latter defined
2575
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
2576
- cachedClearTimeout = clearTimeout;
2577
- return clearTimeout(marker);
2578
- }
2579
- try {
2580
- // when when somebody has screwed with setTimeout but no I.E. maddness
2581
- return cachedClearTimeout(marker);
2582
- } catch (e){
2583
- try {
2584
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
2585
- return cachedClearTimeout.call(null, marker);
2586
- } catch (e){
2587
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
2588
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
2589
- return cachedClearTimeout.call(this, marker);
2590
- }
2591
- }
2592
-
2593
-
2594
-
2595
- }
2596
- var queue = [];
2597
- var draining = false;
2598
- var currentQueue;
2599
- var queueIndex = -1;
2600
-
2601
- function cleanUpNextTick() {
2602
- if (!draining || !currentQueue) {
2603
- return;
2604
- }
2605
- draining = false;
2606
- if (currentQueue.length) {
2607
- queue = currentQueue.concat(queue);
2608
- } else {
2609
- queueIndex = -1;
2610
- }
2611
- if (queue.length) {
2612
- drainQueue();
2613
- }
2614
- }
2615
-
2616
- function drainQueue() {
2617
- if (draining) {
2618
- return;
2619
- }
2620
- var timeout = runTimeout(cleanUpNextTick);
2621
- draining = true;
2622
-
2623
- var len = queue.length;
2624
- while(len) {
2625
- currentQueue = queue;
2626
- queue = [];
2627
- while (++queueIndex < len) {
2628
- if (currentQueue) {
2629
- currentQueue[queueIndex].run();
2630
- }
2631
- }
2632
- queueIndex = -1;
2633
- len = queue.length;
2634
- }
2635
- currentQueue = null;
2636
- draining = false;
2637
- runClearTimeout(timeout);
2638
- }
2639
- function nextTick(fun) {
2640
- var args = new Array(arguments.length - 1);
2641
- if (arguments.length > 1) {
2642
- for (var i = 1; i < arguments.length; i++) {
2643
- args[i - 1] = arguments[i];
2644
- }
2645
- }
2646
- queue.push(new Item(fun, args));
2647
- if (queue.length === 1 && !draining) {
2648
- runTimeout(drainQueue);
2649
- }
2650
- }
2651
- // v8 likes predictible objects
2652
- function Item(fun, array) {
2653
- this.fun = fun;
2654
- this.array = array;
2655
- }
2656
- Item.prototype.run = function () {
2657
- this.fun.apply(null, this.array);
2658
- };
2659
- var title = 'browser';
2660
- var platform = 'browser';
2661
- var browser = true;
2662
- var env = {};
2663
- var argv = [];
2664
- var version = ''; // empty string to avoid regexp issues
2665
- var versions = {};
2666
- var release = {};
2667
- var config = {};
2668
-
2669
- function noop() {}
2670
-
2671
- var on = noop;
2672
- var addListener = noop;
2673
- var once = noop;
2674
- var off = noop;
2675
- var removeListener = noop;
2676
- var removeAllListeners = noop;
2677
- var emit = noop;
2678
-
2679
- function binding(name) {
2680
- throw new Error('process.binding is not supported');
2681
- }
2682
-
2683
- function cwd () { return '/' }
2684
- function chdir (dir) {
2685
- throw new Error('process.chdir is not supported');
2686
- }function umask() { return 0; }
2687
-
2688
- // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
2689
- var performance$1 = global$1.performance || {};
2690
- var performanceNow =
2691
- performance$1.now ||
2692
- performance$1.mozNow ||
2693
- performance$1.msNow ||
2694
- performance$1.oNow ||
2695
- performance$1.webkitNow ||
2696
- function(){ return (new Date()).getTime() };
2697
-
2698
- // generate timestamp or delta
2699
- // see http://nodejs.org/api/process.html#process_process_hrtime
2700
- function hrtime(previousTimestamp){
2701
- var clocktime = performanceNow.call(performance$1)*1e-3;
2702
- var seconds = Math.floor(clocktime);
2703
- var nanoseconds = Math.floor((clocktime%1)*1e9);
2704
- if (previousTimestamp) {
2705
- seconds = seconds - previousTimestamp[0];
2706
- nanoseconds = nanoseconds - previousTimestamp[1];
2707
- if (nanoseconds<0) {
2708
- seconds--;
2709
- nanoseconds += 1e9;
2710
- }
2711
- }
2712
- return [seconds,nanoseconds]
2713
- }
2714
-
2715
- var startTime = new Date();
2716
- function uptime() {
2717
- var currentTime = new Date();
2718
- var dif = currentTime - startTime;
2719
- return dif / 1000;
2720
- }
2721
-
2722
- var browser$1 = {
2723
- nextTick: nextTick,
2724
- title: title,
2725
- browser: browser,
2726
- env: env,
2727
- argv: argv,
2728
- version: version,
2729
- versions: versions,
2730
- on: on,
2731
- addListener: addListener,
2732
- once: once,
2733
- off: off,
2734
- removeListener: removeListener,
2735
- removeAllListeners: removeAllListeners,
2736
- emit: emit,
2737
- binding: binding,
2738
- cwd: cwd,
2739
- chdir: chdir,
2740
- umask: umask,
2741
- hrtime: hrtime,
2742
- platform: platform,
2743
- release: release,
2744
- config: config,
2745
- uptime: uptime
2746
- };
2747
-
2748
- var process$1 = browser$1;
2749
-
2750
2497
  var reactDom = {exports: {}};
2751
2498
 
2752
2499
  var reactDom_development = {};
@@ -2755,6 +2502,16 @@ var scheduler = {exports: {}};
2755
2502
 
2756
2503
  var scheduler_development = {};
2757
2504
 
2505
+ /**
2506
+ * @license React
2507
+ * scheduler.development.js
2508
+ *
2509
+ * Copyright (c) Facebook, Inc. and its affiliates.
2510
+ *
2511
+ * This source code is licensed under the MIT license found in the
2512
+ * LICENSE file in the root directory of this source tree.
2513
+ */
2514
+
2758
2515
  var hasRequiredScheduler_development;
2759
2516
 
2760
2517
  function requireScheduler_development () {
@@ -2762,7 +2519,7 @@ function requireScheduler_development () {
2762
2519
  hasRequiredScheduler_development = 1;
2763
2520
  (function (exports) {
2764
2521
 
2765
- if (process$1.env.NODE_ENV !== "production") {
2522
+ if (process.env.NODE_ENV !== "production") {
2766
2523
  (function() {
2767
2524
 
2768
2525
  /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
@@ -3412,7 +3169,7 @@ function requireScheduler () {
3412
3169
  if (hasRequiredScheduler) return scheduler.exports;
3413
3170
  hasRequiredScheduler = 1;
3414
3171
 
3415
- if (process$1.env.NODE_ENV === 'production') {
3172
+ if (process.env.NODE_ENV === 'production') {
3416
3173
  scheduler.exports = requireScheduler_production_min();
3417
3174
  } else {
3418
3175
  scheduler.exports = requireScheduler_development();
@@ -3420,13 +3177,23 @@ function requireScheduler () {
3420
3177
  return scheduler.exports;
3421
3178
  }
3422
3179
 
3180
+ /**
3181
+ * @license React
3182
+ * react-dom.development.js
3183
+ *
3184
+ * Copyright (c) Facebook, Inc. and its affiliates.
3185
+ *
3186
+ * This source code is licensed under the MIT license found in the
3187
+ * LICENSE file in the root directory of this source tree.
3188
+ */
3189
+
3423
3190
  var hasRequiredReactDom_development;
3424
3191
 
3425
3192
  function requireReactDom_development () {
3426
3193
  if (hasRequiredReactDom_development) return reactDom_development;
3427
3194
  hasRequiredReactDom_development = 1;
3428
3195
 
3429
- if (process$1.env.NODE_ENV !== "production") {
3196
+ if (process.env.NODE_ENV !== "production") {
3430
3197
  (function() {
3431
3198
 
3432
3199
  /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
@@ -33597,7 +33364,7 @@ function checkDCE() {
33597
33364
  ) {
33598
33365
  return;
33599
33366
  }
33600
- if (process$1.env.NODE_ENV !== 'production') {
33367
+ if (process.env.NODE_ENV !== 'production') {
33601
33368
  // This branch is unreachable because this function is only called
33602
33369
  // in production, but the condition is true only in development.
33603
33370
  // Therefore if the branch is still here, dead code elimination wasn't
@@ -33617,7 +33384,7 @@ function checkDCE() {
33617
33384
  }
33618
33385
  }
33619
33386
 
33620
- if (process$1.env.NODE_ENV === 'production') {
33387
+ if (process.env.NODE_ENV === 'production') {
33621
33388
  // DCE check should happen before ReactDOM bundle executes so that
33622
33389
  // DevTools can report bad minification during injection.
33623
33390
  checkDCE();
@@ -60233,6 +60000,15 @@ var reactIs = {exports: {}};
60233
60000
 
60234
60001
  var reactIs_development = {};
60235
60002
 
60003
+ /** @license React v16.13.1
60004
+ * react-is.development.js
60005
+ *
60006
+ * Copyright (c) Facebook, Inc. and its affiliates.
60007
+ *
60008
+ * This source code is licensed under the MIT license found in the
60009
+ * LICENSE file in the root directory of this source tree.
60010
+ */
60011
+
60236
60012
  var hasRequiredReactIs_development;
60237
60013
 
60238
60014
  function requireReactIs_development () {
@@ -60241,7 +60017,7 @@ function requireReactIs_development () {
60241
60017
 
60242
60018
 
60243
60019
 
60244
- if (process$1.env.NODE_ENV !== "production") {
60020
+ if (process.env.NODE_ENV !== "production") {
60245
60021
  (function() {
60246
60022
 
60247
60023
  // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
@@ -60442,7 +60218,7 @@ function requireReactIs () {
60442
60218
  if (hasRequiredReactIs) return reactIs.exports;
60443
60219
  hasRequiredReactIs = 1;
60444
60220
 
60445
- if (process$1.env.NODE_ENV === 'production') {
60221
+ if (process.env.NODE_ENV === 'production') {
60446
60222
  reactIs.exports = requireReactIs_production_min();
60447
60223
  } else {
60448
60224
  reactIs.exports = requireReactIs_development();
@@ -60558,6 +60334,13 @@ function requireHas () {
60558
60334
  return has;
60559
60335
  }
60560
60336
 
60337
+ /**
60338
+ * Copyright (c) 2013-present, Facebook, Inc.
60339
+ *
60340
+ * This source code is licensed under the MIT license found in the
60341
+ * LICENSE file in the root directory of this source tree.
60342
+ */
60343
+
60561
60344
  var checkPropTypes_1;
60562
60345
  var hasRequiredCheckPropTypes;
60563
60346
 
@@ -60567,7 +60350,7 @@ function requireCheckPropTypes () {
60567
60350
 
60568
60351
  var printWarning = function() {};
60569
60352
 
60570
- if (process$1.env.NODE_ENV !== 'production') {
60353
+ if (process.env.NODE_ENV !== 'production') {
60571
60354
  var ReactPropTypesSecret = requireReactPropTypesSecret();
60572
60355
  var loggedTypeFailures = {};
60573
60356
  var has = requireHas();
@@ -60598,7 +60381,7 @@ function requireCheckPropTypes () {
60598
60381
  * @private
60599
60382
  */
60600
60383
  function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
60601
- if (process$1.env.NODE_ENV !== 'production') {
60384
+ if (process.env.NODE_ENV !== 'production') {
60602
60385
  for (var typeSpecName in typeSpecs) {
60603
60386
  if (has(typeSpecs, typeSpecName)) {
60604
60387
  var error;
@@ -60653,7 +60436,7 @@ function requireCheckPropTypes () {
60653
60436
  * @private
60654
60437
  */
60655
60438
  checkPropTypes.resetWarningCache = function() {
60656
- if (process$1.env.NODE_ENV !== 'production') {
60439
+ if (process.env.NODE_ENV !== 'production') {
60657
60440
  loggedTypeFailures = {};
60658
60441
  }
60659
60442
  };
@@ -60662,6 +60445,13 @@ function requireCheckPropTypes () {
60662
60445
  return checkPropTypes_1;
60663
60446
  }
60664
60447
 
60448
+ /**
60449
+ * Copyright (c) 2013-present, Facebook, Inc.
60450
+ *
60451
+ * This source code is licensed under the MIT license found in the
60452
+ * LICENSE file in the root directory of this source tree.
60453
+ */
60454
+
60665
60455
  var factoryWithTypeCheckers;
60666
60456
  var hasRequiredFactoryWithTypeCheckers;
60667
60457
 
@@ -60678,7 +60468,7 @@ function requireFactoryWithTypeCheckers () {
60678
60468
 
60679
60469
  var printWarning = function() {};
60680
60470
 
60681
- if (process$1.env.NODE_ENV !== 'production') {
60471
+ if (process.env.NODE_ENV !== 'production') {
60682
60472
  printWarning = function(text) {
60683
60473
  var message = 'Warning: ' + text;
60684
60474
  if (typeof console !== 'undefined') {
@@ -60831,7 +60621,7 @@ function requireFactoryWithTypeCheckers () {
60831
60621
  PropTypeError.prototype = Error.prototype;
60832
60622
 
60833
60623
  function createChainableTypeChecker(validate) {
60834
- if (process$1.env.NODE_ENV !== 'production') {
60624
+ if (process.env.NODE_ENV !== 'production') {
60835
60625
  var manualPropTypeCallCache = {};
60836
60626
  var manualPropTypeWarningCount = 0;
60837
60627
  }
@@ -60849,7 +60639,7 @@ function requireFactoryWithTypeCheckers () {
60849
60639
  );
60850
60640
  err.name = 'Invariant Violation';
60851
60641
  throw err;
60852
- } else if (process$1.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
60642
+ } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
60853
60643
  // Old behavior for people using React.PropTypes
60854
60644
  var cacheKey = componentName + ':' + propName;
60855
60645
  if (
@@ -60971,7 +60761,7 @@ function requireFactoryWithTypeCheckers () {
60971
60761
 
60972
60762
  function createEnumTypeChecker(expectedValues) {
60973
60763
  if (!Array.isArray(expectedValues)) {
60974
- if (process$1.env.NODE_ENV !== 'production') {
60764
+ if (process.env.NODE_ENV !== 'production') {
60975
60765
  if (arguments.length > 1) {
60976
60766
  printWarning(
60977
60767
  'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
@@ -61029,7 +60819,7 @@ function requireFactoryWithTypeCheckers () {
61029
60819
 
61030
60820
  function createUnionTypeChecker(arrayOfTypeCheckers) {
61031
60821
  if (!Array.isArray(arrayOfTypeCheckers)) {
61032
- process$1.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
60822
+ process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
61033
60823
  return emptyFunctionThatReturnsNull;
61034
60824
  }
61035
60825
 
@@ -61273,7 +61063,14 @@ function requireFactoryWithTypeCheckers () {
61273
61063
  return factoryWithTypeCheckers;
61274
61064
  }
61275
61065
 
61276
- if (process$1.env.NODE_ENV !== 'production') {
61066
+ /**
61067
+ * Copyright (c) 2013-present, Facebook, Inc.
61068
+ *
61069
+ * This source code is licensed under the MIT license found in the
61070
+ * LICENSE file in the root directory of this source tree.
61071
+ */
61072
+
61073
+ if (process.env.NODE_ENV !== 'production') {
61277
61074
  var ReactIs = requireReactIs();
61278
61075
 
61279
61076
  // By explicitly using `prop-types` you are opting into new development behavior.
@@ -65226,7 +65023,7 @@ function isString$1(str) {
65226
65023
  }
65227
65024
 
65228
65025
  /** Checks if value is object */
65229
- function isObject$2(obj) {
65026
+ function isObject$3(obj) {
65230
65027
  var _obj$constructor;
65231
65028
  return typeof obj === 'object' && obj != null && (obj == null || (_obj$constructor = obj.constructor) == null ? void 0 : _obj$constructor.name) === 'Object';
65232
65029
  }
@@ -65430,7 +65227,7 @@ function normalizeOpts(opts) {
65430
65227
  ...instanceOpts
65431
65228
  } = opts instanceof IMask.Masked ? {
65432
65229
  mask: opts
65433
- } : isObject$2(opts) && opts.mask instanceof IMask.Masked ? opts : {};
65230
+ } : isObject$3(opts) && opts.mask instanceof IMask.Masked ? opts : {};
65434
65231
  if (mask) {
65435
65232
  const _mask = mask.mask;
65436
65233
  return {
@@ -65441,7 +65238,7 @@ function normalizeOpts(opts) {
65441
65238
  };
65442
65239
  }
65443
65240
  }
65444
- if (!isObject$2(opts)) return {
65241
+ if (!isObject$3(opts)) return {
65445
65242
  mask: opts
65446
65243
  };
65447
65244
  return {
@@ -70802,7 +70599,7 @@ function baseToString(value) {
70802
70599
  return result == '0' && 1 / value == -INFINITY ? '-0' : result
70803
70600
  }
70804
70601
 
70805
- function toString$2(value) {
70602
+ function toString$1(value) {
70806
70603
  return value == null ? '' : baseToString(value)
70807
70604
  }
70808
70605
 
@@ -70815,7 +70612,7 @@ function isNumber(value) {
70815
70612
  }
70816
70613
 
70817
70614
  // Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js
70818
- function isBoolean(value) {
70615
+ function isBoolean$1(value) {
70819
70616
  return (
70820
70617
  value === true ||
70821
70618
  value === false ||
@@ -70823,13 +70620,13 @@ function isBoolean(value) {
70823
70620
  )
70824
70621
  }
70825
70622
 
70826
- function isObject$1(value) {
70623
+ function isObject$2(value) {
70827
70624
  return typeof value === 'object'
70828
70625
  }
70829
70626
 
70830
70627
  // Checks if `value` is object-like.
70831
70628
  function isObjectLike(value) {
70832
- return isObject$1(value) && value !== null
70629
+ return isObject$2(value) && value !== null
70833
70630
  }
70834
70631
 
70835
70632
  function isDefined$1(value) {
@@ -70968,9 +70765,9 @@ function get(obj, path) {
70968
70765
  // add it to the list
70969
70766
  if (
70970
70767
  index === path.length - 1 &&
70971
- (isString(value) || isNumber(value) || isBoolean(value))
70768
+ (isString(value) || isNumber(value) || isBoolean$1(value))
70972
70769
  ) {
70973
- list.push(toString$2(value));
70770
+ list.push(toString$1(value));
70974
70771
  } else if (isArray$2(value)) {
70975
70772
  arr = true;
70976
70773
  // Search each item in the array.
@@ -72127,7 +71924,7 @@ const isExpression = (query) =>
72127
71924
  const isPath = (query) => !!query[KeyType.PATH];
72128
71925
 
72129
71926
  const isLeaf = (query) =>
72130
- !isArray$2(query) && isObject$1(query) && !isExpression(query);
71927
+ !isArray$2(query) && isObject$2(query) && !isExpression(query);
72131
71928
 
72132
71929
  const convertToExplicit = (query) => ({
72133
71930
  [LogicalOperator.AND]: Object.keys(query).map((key) => ({
@@ -72555,2461 +72352,146 @@ Fuse.config = Config;
72555
72352
  register(ExtendedSearch);
72556
72353
  }
72557
72354
 
72558
- var lookup = [];
72559
- var revLookup = [];
72560
- var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
72561
- var inited = false;
72562
- function init () {
72563
- inited = true;
72564
- var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
72565
- for (var i = 0, len = code.length; i < len; ++i) {
72566
- lookup[i] = code[i];
72567
- revLookup[code.charCodeAt(i)] = i;
72568
- }
72569
-
72570
- revLookup['-'.charCodeAt(0)] = 62;
72571
- revLookup['_'.charCodeAt(0)] = 63;
72572
- }
72573
-
72574
- function toByteArray (b64) {
72575
- if (!inited) {
72576
- init();
72577
- }
72578
- var i, j, l, tmp, placeHolders, arr;
72579
- var len = b64.length;
72580
-
72581
- if (len % 4 > 0) {
72582
- throw new Error('Invalid string. Length must be a multiple of 4')
72583
- }
72584
-
72585
- // the number of equal signs (place holders)
72586
- // if there are two placeholders, than the two characters before it
72587
- // represent one byte
72588
- // if there is only one, then the three characters before it represent 2 bytes
72589
- // this is just a cheap hack to not do indexOf twice
72590
- placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0;
72591
-
72592
- // base64 is 4/3 + up to two characters of the original data
72593
- arr = new Arr(len * 3 / 4 - placeHolders);
72594
-
72595
- // if there are placeholders, only get up to the last complete 4 chars
72596
- l = placeHolders > 0 ? len - 4 : len;
72597
-
72598
- var L = 0;
72599
-
72600
- for (i = 0, j = 0; i < l; i += 4, j += 3) {
72601
- tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)];
72602
- arr[L++] = (tmp >> 16) & 0xFF;
72603
- arr[L++] = (tmp >> 8) & 0xFF;
72604
- arr[L++] = tmp & 0xFF;
72605
- }
72606
-
72607
- if (placeHolders === 2) {
72608
- tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4);
72609
- arr[L++] = tmp & 0xFF;
72610
- } else if (placeHolders === 1) {
72611
- tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2);
72612
- arr[L++] = (tmp >> 8) & 0xFF;
72613
- arr[L++] = tmp & 0xFF;
72614
- }
72615
-
72616
- return arr
72617
- }
72618
-
72619
- function tripletToBase64 (num) {
72620
- return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
72621
- }
72622
-
72623
- function encodeChunk (uint8, start, end) {
72624
- var tmp;
72625
- var output = [];
72626
- for (var i = start; i < end; i += 3) {
72627
- tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);
72628
- output.push(tripletToBase64(tmp));
72629
- }
72630
- return output.join('')
72631
- }
72632
-
72633
- function fromByteArray (uint8) {
72634
- if (!inited) {
72635
- init();
72636
- }
72637
- var tmp;
72638
- var len = uint8.length;
72639
- var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
72640
- var output = '';
72641
- var parts = [];
72642
- var maxChunkLength = 16383; // must be multiple of 3
72643
-
72644
- // go through the array every three bytes, we'll deal with trailing stuff later
72645
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
72646
- parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)));
72647
- }
72648
-
72649
- // pad the end with zeros, but make sure to not forget the extra bytes
72650
- if (extraBytes === 1) {
72651
- tmp = uint8[len - 1];
72652
- output += lookup[tmp >> 2];
72653
- output += lookup[(tmp << 4) & 0x3F];
72654
- output += '==';
72655
- } else if (extraBytes === 2) {
72656
- tmp = (uint8[len - 2] << 8) + (uint8[len - 1]);
72657
- output += lookup[tmp >> 10];
72658
- output += lookup[(tmp >> 4) & 0x3F];
72659
- output += lookup[(tmp << 2) & 0x3F];
72660
- output += '=';
72661
- }
72662
-
72663
- parts.push(output);
72664
-
72665
- return parts.join('')
72666
- }
72667
-
72668
- function read (buffer, offset, isLE, mLen, nBytes) {
72669
- var e, m;
72670
- var eLen = nBytes * 8 - mLen - 1;
72671
- var eMax = (1 << eLen) - 1;
72672
- var eBias = eMax >> 1;
72673
- var nBits = -7;
72674
- var i = isLE ? (nBytes - 1) : 0;
72675
- var d = isLE ? -1 : 1;
72676
- var s = buffer[offset + i];
72677
-
72678
- i += d;
72679
-
72680
- e = s & ((1 << (-nBits)) - 1);
72681
- s >>= (-nBits);
72682
- nBits += eLen;
72683
- for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
72684
-
72685
- m = e & ((1 << (-nBits)) - 1);
72686
- e >>= (-nBits);
72687
- nBits += mLen;
72688
- for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
72689
-
72690
- if (e === 0) {
72691
- e = 1 - eBias;
72692
- } else if (e === eMax) {
72693
- return m ? NaN : ((s ? -1 : 1) * Infinity)
72694
- } else {
72695
- m = m + Math.pow(2, mLen);
72696
- e = e - eBias;
72697
- }
72698
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
72699
- }
72700
-
72701
- function write (buffer, value, offset, isLE, mLen, nBytes) {
72702
- var e, m, c;
72703
- var eLen = nBytes * 8 - mLen - 1;
72704
- var eMax = (1 << eLen) - 1;
72705
- var eBias = eMax >> 1;
72706
- var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0);
72707
- var i = isLE ? 0 : (nBytes - 1);
72708
- var d = isLE ? 1 : -1;
72709
- var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;
72710
-
72711
- value = Math.abs(value);
72712
-
72713
- if (isNaN(value) || value === Infinity) {
72714
- m = isNaN(value) ? 1 : 0;
72715
- e = eMax;
72716
- } else {
72717
- e = Math.floor(Math.log(value) / Math.LN2);
72718
- if (value * (c = Math.pow(2, -e)) < 1) {
72719
- e--;
72720
- c *= 2;
72721
- }
72722
- if (e + eBias >= 1) {
72723
- value += rt / c;
72724
- } else {
72725
- value += rt * Math.pow(2, 1 - eBias);
72726
- }
72727
- if (value * c >= 2) {
72728
- e++;
72729
- c /= 2;
72730
- }
72731
-
72732
- if (e + eBias >= eMax) {
72733
- m = 0;
72734
- e = eMax;
72735
- } else if (e + eBias >= 1) {
72736
- m = (value * c - 1) * Math.pow(2, mLen);
72737
- e = e + eBias;
72738
- } else {
72739
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
72740
- e = 0;
72741
- }
72742
- }
72743
-
72744
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
72745
-
72746
- e = (e << mLen) | m;
72747
- eLen += mLen;
72748
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
72749
-
72750
- buffer[offset + i - d] |= s * 128;
72751
- }
72752
-
72753
- var toString$1 = {}.toString;
72754
-
72755
- var isArray$1 = Array.isArray || function (arr) {
72756
- return toString$1.call(arr) == '[object Array]';
72355
+ var defaults = {
72356
+ space: '',
72357
+ cycles: false,
72358
+ replacer: (k, v) => v,
72359
+ stringify: JSON.stringify
72757
72360
  };
72758
72361
 
72759
- /*!
72760
- * The buffer module from node.js, for the browser.
72761
- *
72762
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
72763
- * @license MIT
72764
- */
72765
-
72766
- var INSPECT_MAX_BYTES = 50;
72767
-
72768
- /**
72769
- * If `Buffer.TYPED_ARRAY_SUPPORT`:
72770
- * === true Use Uint8Array implementation (fastest)
72771
- * === false Use Object implementation (most compatible, even IE6)
72772
- *
72773
- * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
72774
- * Opera 11.6+, iOS 4.2+.
72775
- *
72776
- * Due to various browser bugs, sometimes the Object implementation will be used even
72777
- * when the browser supports typed arrays.
72778
- *
72779
- * Note:
72780
- *
72781
- * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
72782
- * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
72783
- *
72784
- * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
72785
- *
72786
- * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
72787
- * incorrect length in some situations.
72788
-
72789
- * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
72790
- * get the Object implementation, which is slower but behaves correctly.
72791
- */
72792
- Buffer.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== undefined
72793
- ? global$1.TYPED_ARRAY_SUPPORT
72794
- : true;
72795
-
72796
- /*
72797
- * Export kMaxLength after typed array support is determined.
72798
- */
72799
- kMaxLength();
72800
-
72801
- function kMaxLength () {
72802
- return Buffer.TYPED_ARRAY_SUPPORT
72803
- ? 0x7fffffff
72804
- : 0x3fffffff
72805
- }
72806
-
72807
- function createBuffer (that, length) {
72808
- if (kMaxLength() < length) {
72809
- throw new RangeError('Invalid typed array length')
72810
- }
72811
- if (Buffer.TYPED_ARRAY_SUPPORT) {
72812
- // Return an augmented `Uint8Array` instance, for best performance
72813
- that = new Uint8Array(length);
72814
- that.__proto__ = Buffer.prototype;
72815
- } else {
72816
- // Fallback: Return an object instance of the Buffer class
72817
- if (that === null) {
72818
- that = new Buffer(length);
72819
- }
72820
- that.length = length;
72821
- }
72822
-
72823
- return that
72824
- }
72825
-
72826
- /**
72827
- * The Buffer constructor returns instances of `Uint8Array` that have their
72828
- * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
72829
- * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
72830
- * and the `Uint8Array` methods. Square bracket notation works as expected -- it
72831
- * returns a single octet.
72832
- *
72833
- * The `Uint8Array` prototype remains unmodified.
72834
- */
72835
-
72836
- function Buffer (arg, encodingOrOffset, length) {
72837
- if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
72838
- return new Buffer(arg, encodingOrOffset, length)
72839
- }
72840
-
72841
- // Common case.
72842
- if (typeof arg === 'number') {
72843
- if (typeof encodingOrOffset === 'string') {
72844
- throw new Error(
72845
- 'If encoding is specified then the first argument must be a string'
72846
- )
72847
- }
72848
- return allocUnsafe(this, arg)
72849
- }
72850
- return from(this, arg, encodingOrOffset, length)
72851
- }
72852
-
72853
- Buffer.poolSize = 8192; // not used by this implementation
72854
-
72855
- // TODO: Legacy, not needed anymore. Remove in next major version.
72856
- Buffer._augment = function (arr) {
72857
- arr.__proto__ = Buffer.prototype;
72858
- return arr
72362
+ var util = {
72363
+ isArray: Array.isArray,
72364
+ assign: Object.assign,
72365
+ isObject: v => typeof v === 'object',
72366
+ isFunction: v => typeof v === 'function',
72367
+ isBoolean: v => typeof v === 'boolean',
72368
+ isRegex: v => v instanceof RegExp,
72369
+ keys: Object.keys
72859
72370
  };
72860
72371
 
72861
- function from (that, value, encodingOrOffset, length) {
72862
- if (typeof value === 'number') {
72863
- throw new TypeError('"value" argument must not be a number')
72864
- }
72865
-
72866
- if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
72867
- return fromArrayBuffer(that, value, encodingOrOffset, length)
72868
- }
72869
-
72870
- if (typeof value === 'string') {
72871
- return fromString(that, value, encodingOrOffset)
72872
- }
72873
-
72874
- return fromObject(that, value)
72372
+ const DEFAULTS = defaults;
72373
+ const isFunction$1 = util.isFunction;
72374
+ const isBoolean = util.isBoolean;
72375
+ const isObject$1 = util.isObject;
72376
+ const isArray$1 = util.isArray;
72377
+ const isRegex = util.isRegex;
72378
+ const assign = util.assign;
72379
+ const keys = util.keys;
72380
+
72381
+ function serialize (obj) {
72382
+ if (obj === null || obj === undefined) return obj
72383
+ if (isRegex(obj)) return obj.toString()
72384
+ return obj.toJSON ? obj.toJSON() : obj
72875
72385
  }
72876
72386
 
72877
- /**
72878
- * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
72879
- * if value is a number.
72880
- * Buffer.from(str[, encoding])
72881
- * Buffer.from(array)
72882
- * Buffer.from(buffer)
72883
- * Buffer.from(arrayBuffer[, byteOffset[, length]])
72884
- **/
72885
- Buffer.from = function (value, encodingOrOffset, length) {
72886
- return from(null, value, encodingOrOffset, length)
72887
- };
72387
+ function stringifyDeterministic (obj, opts) {
72388
+ opts = opts || assign({}, DEFAULTS);
72888
72389
 
72889
- if (Buffer.TYPED_ARRAY_SUPPORT) {
72890
- Buffer.prototype.__proto__ = Uint8Array.prototype;
72891
- Buffer.__proto__ = Uint8Array;
72892
- }
72893
-
72894
- function assertSize (size) {
72895
- if (typeof size !== 'number') {
72896
- throw new TypeError('"size" argument must be a number')
72897
- } else if (size < 0) {
72898
- throw new RangeError('"size" argument must not be negative')
72899
- }
72900
- }
72390
+ if (isFunction$1(opts)) opts = { compare: opts };
72901
72391
 
72902
- function alloc (that, size, fill, encoding) {
72903
- assertSize(size);
72904
- if (size <= 0) {
72905
- return createBuffer(that, size)
72906
- }
72907
- if (fill !== undefined) {
72908
- // Only pay attention to encoding if it's a string. This
72909
- // prevents accidentally sending in a number that would
72910
- // be interpretted as a start offset.
72911
- return typeof encoding === 'string'
72912
- ? createBuffer(that, size).fill(fill, encoding)
72913
- : createBuffer(that, size).fill(fill)
72914
- }
72915
- return createBuffer(that, size)
72916
- }
72392
+ const space = opts.space || DEFAULTS.space;
72393
+ const cycles = isBoolean(opts.cycles) ? opts.cycles : DEFAULTS.cycles;
72394
+ const replacer = opts.replacer || DEFAULTS.replacer;
72395
+ const stringify = opts.stringify || DEFAULTS.stringify;
72917
72396
 
72918
- /**
72919
- * Creates a new filled Buffer instance.
72920
- * alloc(size[, fill[, encoding]])
72921
- **/
72922
- Buffer.alloc = function (size, fill, encoding) {
72923
- return alloc(null, size, fill, encoding)
72924
- };
72925
-
72926
- function allocUnsafe (that, size) {
72927
- assertSize(size);
72928
- that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
72929
- if (!Buffer.TYPED_ARRAY_SUPPORT) {
72930
- for (var i = 0; i < size; ++i) {
72931
- that[i] = 0;
72932
- }
72933
- }
72934
- return that
72935
- }
72936
-
72937
- /**
72938
- * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
72939
- * */
72940
- Buffer.allocUnsafe = function (size) {
72941
- return allocUnsafe(null, size)
72942
- };
72943
- /**
72944
- * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
72945
- */
72946
- Buffer.allocUnsafeSlow = function (size) {
72947
- return allocUnsafe(null, size)
72948
- };
72949
-
72950
- function fromString (that, string, encoding) {
72951
- if (typeof encoding !== 'string' || encoding === '') {
72952
- encoding = 'utf8';
72953
- }
72954
-
72955
- if (!Buffer.isEncoding(encoding)) {
72956
- throw new TypeError('"encoding" must be a valid string encoding')
72957
- }
72958
-
72959
- var length = byteLength(string, encoding) | 0;
72960
- that = createBuffer(that, length);
72961
-
72962
- var actual = that.write(string, encoding);
72963
-
72964
- if (actual !== length) {
72965
- // Writing a hex string, for example, that contains invalid characters will
72966
- // cause everything after the first invalid character to be ignored. (e.g.
72967
- // 'abxxcd' will be treated as 'ab')
72968
- that = that.slice(0, actual);
72969
- }
72970
-
72971
- return that
72972
- }
72973
-
72974
- function fromArrayLike (that, array) {
72975
- var length = array.length < 0 ? 0 : checked(array.length) | 0;
72976
- that = createBuffer(that, length);
72977
- for (var i = 0; i < length; i += 1) {
72978
- that[i] = array[i] & 255;
72979
- }
72980
- return that
72981
- }
72982
-
72983
- function fromArrayBuffer (that, array, byteOffset, length) {
72984
- array.byteLength; // this throws if `array` is not a valid ArrayBuffer
72985
-
72986
- if (byteOffset < 0 || array.byteLength < byteOffset) {
72987
- throw new RangeError('\'offset\' is out of bounds')
72988
- }
72989
-
72990
- if (array.byteLength < byteOffset + (length || 0)) {
72991
- throw new RangeError('\'length\' is out of bounds')
72992
- }
72993
-
72994
- if (byteOffset === undefined && length === undefined) {
72995
- array = new Uint8Array(array);
72996
- } else if (length === undefined) {
72997
- array = new Uint8Array(array, byteOffset);
72998
- } else {
72999
- array = new Uint8Array(array, byteOffset, length);
73000
- }
73001
-
73002
- if (Buffer.TYPED_ARRAY_SUPPORT) {
73003
- // Return an augmented `Uint8Array` instance, for best performance
73004
- that = array;
73005
- that.__proto__ = Buffer.prototype;
73006
- } else {
73007
- // Fallback: Return an object instance of the Buffer class
73008
- that = fromArrayLike(that, array);
73009
- }
73010
- return that
73011
- }
73012
-
73013
- function fromObject (that, obj) {
73014
- if (internalIsBuffer(obj)) {
73015
- var len = checked(obj.length) | 0;
73016
- that = createBuffer(that, len);
73017
-
73018
- if (that.length === 0) {
73019
- return that
73020
- }
73021
-
73022
- obj.copy(that, 0, 0, len);
73023
- return that
73024
- }
73025
-
73026
- if (obj) {
73027
- if ((typeof ArrayBuffer !== 'undefined' &&
73028
- obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
73029
- if (typeof obj.length !== 'number' || isnan(obj.length)) {
73030
- return createBuffer(that, 0)
72397
+ const compare = opts.compare && (function (f) {
72398
+ return function (node) {
72399
+ return function (a, b) {
72400
+ const aobj = { key: a, value: node[a] };
72401
+ const bobj = { key: b, value: node[b] };
72402
+ return f(aobj, bobj)
73031
72403
  }
73032
- return fromArrayLike(that, obj)
73033
72404
  }
72405
+ })(opts.compare);
73034
72406
 
73035
- if (obj.type === 'Buffer' && isArray$1(obj.data)) {
73036
- return fromArrayLike(that, obj.data)
73037
- }
73038
- }
73039
-
73040
- throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
73041
- }
73042
-
73043
- function checked (length) {
73044
- // Note: cannot use `length < kMaxLength()` here because that fails when
73045
- // length is NaN (which is otherwise coerced to zero.)
73046
- if (length >= kMaxLength()) {
73047
- throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
73048
- 'size: 0x' + kMaxLength().toString(16) + ' bytes')
73049
- }
73050
- return length | 0
73051
- }
73052
- Buffer.isBuffer = isBuffer;
73053
- function internalIsBuffer (b) {
73054
- return !!(b != null && b._isBuffer)
73055
- }
73056
-
73057
- Buffer.compare = function compare (a, b) {
73058
- if (!internalIsBuffer(a) || !internalIsBuffer(b)) {
73059
- throw new TypeError('Arguments must be Buffers')
73060
- }
73061
-
73062
- if (a === b) return 0
73063
-
73064
- var x = a.length;
73065
- var y = b.length;
73066
-
73067
- for (var i = 0, len = Math.min(x, y); i < len; ++i) {
73068
- if (a[i] !== b[i]) {
73069
- x = a[i];
73070
- y = b[i];
73071
- break
73072
- }
73073
- }
73074
-
73075
- if (x < y) return -1
73076
- if (y < x) return 1
73077
- return 0
73078
- };
73079
-
73080
- Buffer.isEncoding = function isEncoding (encoding) {
73081
- switch (String(encoding).toLowerCase()) {
73082
- case 'hex':
73083
- case 'utf8':
73084
- case 'utf-8':
73085
- case 'ascii':
73086
- case 'latin1':
73087
- case 'binary':
73088
- case 'base64':
73089
- case 'ucs2':
73090
- case 'ucs-2':
73091
- case 'utf16le':
73092
- case 'utf-16le':
73093
- return true
73094
- default:
73095
- return false
73096
- }
73097
- };
73098
-
73099
- Buffer.concat = function concat (list, length) {
73100
- if (!isArray$1(list)) {
73101
- throw new TypeError('"list" argument must be an Array of Buffers')
73102
- }
73103
-
73104
- if (list.length === 0) {
73105
- return Buffer.alloc(0)
73106
- }
73107
-
73108
- var i;
73109
- if (length === undefined) {
73110
- length = 0;
73111
- for (i = 0; i < list.length; ++i) {
73112
- length += list[i].length;
73113
- }
73114
- }
73115
-
73116
- var buffer = Buffer.allocUnsafe(length);
73117
- var pos = 0;
73118
- for (i = 0; i < list.length; ++i) {
73119
- var buf = list[i];
73120
- if (!internalIsBuffer(buf)) {
73121
- throw new TypeError('"list" argument must be an Array of Buffers')
73122
- }
73123
- buf.copy(buffer, pos);
73124
- pos += buf.length;
73125
- }
73126
- return buffer
73127
- };
73128
-
73129
- function byteLength (string, encoding) {
73130
- if (internalIsBuffer(string)) {
73131
- return string.length
73132
- }
73133
- if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
73134
- (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
73135
- return string.byteLength
73136
- }
73137
- if (typeof string !== 'string') {
73138
- string = '' + string;
73139
- }
73140
-
73141
- var len = string.length;
73142
- if (len === 0) return 0
73143
-
73144
- // Use a for loop to avoid recursion
73145
- var loweredCase = false;
73146
- for (;;) {
73147
- switch (encoding) {
73148
- case 'ascii':
73149
- case 'latin1':
73150
- case 'binary':
73151
- return len
73152
- case 'utf8':
73153
- case 'utf-8':
73154
- case undefined:
73155
- return utf8ToBytes(string).length
73156
- case 'ucs2':
73157
- case 'ucs-2':
73158
- case 'utf16le':
73159
- case 'utf-16le':
73160
- return len * 2
73161
- case 'hex':
73162
- return len >>> 1
73163
- case 'base64':
73164
- return base64ToBytes(string).length
73165
- default:
73166
- if (loweredCase) return utf8ToBytes(string).length // assume utf8
73167
- encoding = ('' + encoding).toLowerCase();
73168
- loweredCase = true;
73169
- }
73170
- }
73171
- }
73172
- Buffer.byteLength = byteLength;
73173
-
73174
- function slowToString (encoding, start, end) {
73175
- var loweredCase = false;
73176
-
73177
- // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
73178
- // property of a typed array.
73179
-
73180
- // This behaves neither like String nor Uint8Array in that we set start/end
73181
- // to their upper/lower bounds if the value passed is out of range.
73182
- // undefined is handled specially as per ECMA-262 6th Edition,
73183
- // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
73184
- if (start === undefined || start < 0) {
73185
- start = 0;
73186
- }
73187
- // Return early if start > this.length. Done here to prevent potential uint32
73188
- // coercion fail below.
73189
- if (start > this.length) {
73190
- return ''
73191
- }
73192
-
73193
- if (end === undefined || end > this.length) {
73194
- end = this.length;
73195
- }
73196
-
73197
- if (end <= 0) {
73198
- return ''
73199
- }
73200
-
73201
- // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
73202
- end >>>= 0;
73203
- start >>>= 0;
73204
-
73205
- if (end <= start) {
73206
- return ''
73207
- }
73208
-
73209
- if (!encoding) encoding = 'utf8';
73210
-
73211
- while (true) {
73212
- switch (encoding) {
73213
- case 'hex':
73214
- return hexSlice(this, start, end)
73215
-
73216
- case 'utf8':
73217
- case 'utf-8':
73218
- return utf8Slice(this, start, end)
73219
-
73220
- case 'ascii':
73221
- return asciiSlice(this, start, end)
73222
-
73223
- case 'latin1':
73224
- case 'binary':
73225
- return latin1Slice(this, start, end)
73226
-
73227
- case 'base64':
73228
- return base64Slice(this, start, end)
73229
-
73230
- case 'ucs2':
73231
- case 'ucs-2':
73232
- case 'utf16le':
73233
- case 'utf-16le':
73234
- return utf16leSlice(this, start, end)
73235
-
73236
- default:
73237
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
73238
- encoding = (encoding + '').toLowerCase();
73239
- loweredCase = true;
73240
- }
73241
- }
73242
- }
73243
-
73244
- // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
73245
- // Buffer instances.
73246
- Buffer.prototype._isBuffer = true;
73247
-
73248
- function swap (b, n, m) {
73249
- var i = b[n];
73250
- b[n] = b[m];
73251
- b[m] = i;
73252
- }
73253
-
73254
- Buffer.prototype.swap16 = function swap16 () {
73255
- var len = this.length;
73256
- if (len % 2 !== 0) {
73257
- throw new RangeError('Buffer size must be a multiple of 16-bits')
73258
- }
73259
- for (var i = 0; i < len; i += 2) {
73260
- swap(this, i, i + 1);
73261
- }
73262
- return this
73263
- };
73264
-
73265
- Buffer.prototype.swap32 = function swap32 () {
73266
- var len = this.length;
73267
- if (len % 4 !== 0) {
73268
- throw new RangeError('Buffer size must be a multiple of 32-bits')
73269
- }
73270
- for (var i = 0; i < len; i += 4) {
73271
- swap(this, i, i + 3);
73272
- swap(this, i + 1, i + 2);
73273
- }
73274
- return this
73275
- };
73276
-
73277
- Buffer.prototype.swap64 = function swap64 () {
73278
- var len = this.length;
73279
- if (len % 8 !== 0) {
73280
- throw new RangeError('Buffer size must be a multiple of 64-bits')
73281
- }
73282
- for (var i = 0; i < len; i += 8) {
73283
- swap(this, i, i + 7);
73284
- swap(this, i + 1, i + 6);
73285
- swap(this, i + 2, i + 5);
73286
- swap(this, i + 3, i + 4);
73287
- }
73288
- return this
73289
- };
73290
-
73291
- Buffer.prototype.toString = function toString () {
73292
- var length = this.length | 0;
73293
- if (length === 0) return ''
73294
- if (arguments.length === 0) return utf8Slice(this, 0, length)
73295
- return slowToString.apply(this, arguments)
73296
- };
73297
-
73298
- Buffer.prototype.equals = function equals (b) {
73299
- if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer')
73300
- if (this === b) return true
73301
- return Buffer.compare(this, b) === 0
73302
- };
73303
-
73304
- Buffer.prototype.inspect = function inspect () {
73305
- var str = '';
73306
- var max = INSPECT_MAX_BYTES;
73307
- if (this.length > 0) {
73308
- str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');
73309
- if (this.length > max) str += ' ... ';
73310
- }
73311
- return '<Buffer ' + str + '>'
73312
- };
73313
-
73314
- Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
73315
- if (!internalIsBuffer(target)) {
73316
- throw new TypeError('Argument must be a Buffer')
73317
- }
73318
-
73319
- if (start === undefined) {
73320
- start = 0;
73321
- }
73322
- if (end === undefined) {
73323
- end = target ? target.length : 0;
73324
- }
73325
- if (thisStart === undefined) {
73326
- thisStart = 0;
73327
- }
73328
- if (thisEnd === undefined) {
73329
- thisEnd = this.length;
73330
- }
73331
-
73332
- if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
73333
- throw new RangeError('out of range index')
73334
- }
72407
+ // Detect circular structure in obj and raise error efficiently.
72408
+ if (!cycles) stringify(obj);
73335
72409
 
73336
- if (thisStart >= thisEnd && start >= end) {
73337
- return 0
73338
- }
73339
- if (thisStart >= thisEnd) {
73340
- return -1
73341
- }
73342
- if (start >= end) {
73343
- return 1
73344
- }
72410
+ const seen = [];
73345
72411
 
73346
- start >>>= 0;
73347
- end >>>= 0;
73348
- thisStart >>>= 0;
73349
- thisEnd >>>= 0;
72412
+ return (function _deterministic (parent, key, node, level) {
72413
+ const indent = space ? ('\n' + new Array(level + 1).join(space)) : '';
72414
+ const colonSeparator = space ? ': ' : ':';
73350
72415
 
73351
- if (this === target) return 0
72416
+ node = serialize(node);
72417
+ node = replacer.call(parent, key, node);
73352
72418
 
73353
- var x = thisEnd - thisStart;
73354
- var y = end - start;
73355
- var len = Math.min(x, y);
72419
+ if (node === undefined) return
73356
72420
 
73357
- var thisCopy = this.slice(thisStart, thisEnd);
73358
- var targetCopy = target.slice(start, end);
72421
+ if (!isObject$1(node) || node === null) return stringify(node)
73359
72422
 
73360
- for (var i = 0; i < len; ++i) {
73361
- if (thisCopy[i] !== targetCopy[i]) {
73362
- x = thisCopy[i];
73363
- y = targetCopy[i];
73364
- break
73365
- }
73366
- }
73367
-
73368
- if (x < y) return -1
73369
- if (y < x) return 1
73370
- return 0
73371
- };
73372
-
73373
- // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
73374
- // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
73375
- //
73376
- // Arguments:
73377
- // - buffer - a Buffer to search
73378
- // - val - a string, Buffer, or number
73379
- // - byteOffset - an index into `buffer`; will be clamped to an int32
73380
- // - encoding - an optional encoding, relevant is val is a string
73381
- // - dir - true for indexOf, false for lastIndexOf
73382
- function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
73383
- // Empty buffer means no match
73384
- if (buffer.length === 0) return -1
73385
-
73386
- // Normalize byteOffset
73387
- if (typeof byteOffset === 'string') {
73388
- encoding = byteOffset;
73389
- byteOffset = 0;
73390
- } else if (byteOffset > 0x7fffffff) {
73391
- byteOffset = 0x7fffffff;
73392
- } else if (byteOffset < -0x80000000) {
73393
- byteOffset = -0x80000000;
73394
- }
73395
- byteOffset = +byteOffset; // Coerce to Number.
73396
- if (isNaN(byteOffset)) {
73397
- // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
73398
- byteOffset = dir ? 0 : (buffer.length - 1);
73399
- }
73400
-
73401
- // Normalize byteOffset: negative offsets start from the end of the buffer
73402
- if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
73403
- if (byteOffset >= buffer.length) {
73404
- if (dir) return -1
73405
- else byteOffset = buffer.length - 1;
73406
- } else if (byteOffset < 0) {
73407
- if (dir) byteOffset = 0;
73408
- else return -1
73409
- }
73410
-
73411
- // Normalize val
73412
- if (typeof val === 'string') {
73413
- val = Buffer.from(val, encoding);
73414
- }
73415
-
73416
- // Finally, search either indexOf (if dir is true) or lastIndexOf
73417
- if (internalIsBuffer(val)) {
73418
- // Special case: looking for empty string/buffer always fails
73419
- if (val.length === 0) {
73420
- return -1
73421
- }
73422
- return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
73423
- } else if (typeof val === 'number') {
73424
- val = val & 0xFF; // Search for a byte value [0-255]
73425
- if (Buffer.TYPED_ARRAY_SUPPORT &&
73426
- typeof Uint8Array.prototype.indexOf === 'function') {
73427
- if (dir) {
73428
- return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
73429
- } else {
73430
- return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
73431
- }
73432
- }
73433
- return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
73434
- }
73435
-
73436
- throw new TypeError('val must be string, number or Buffer')
73437
- }
73438
-
73439
- function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
73440
- var indexSize = 1;
73441
- var arrLength = arr.length;
73442
- var valLength = val.length;
73443
-
73444
- if (encoding !== undefined) {
73445
- encoding = String(encoding).toLowerCase();
73446
- if (encoding === 'ucs2' || encoding === 'ucs-2' ||
73447
- encoding === 'utf16le' || encoding === 'utf-16le') {
73448
- if (arr.length < 2 || val.length < 2) {
73449
- return -1
72423
+ if (isArray$1(node)) {
72424
+ const out = [];
72425
+ for (let i = 0; i < node.length; i++) {
72426
+ const item = _deterministic(node, i, node[i], level + 1) || stringify(null);
72427
+ out.push(indent + space + item);
73450
72428
  }
73451
- indexSize = 2;
73452
- arrLength /= 2;
73453
- valLength /= 2;
73454
- byteOffset /= 2;
73455
- }
73456
- }
73457
-
73458
- function read (buf, i) {
73459
- if (indexSize === 1) {
73460
- return buf[i]
72429
+ return '[' + out.join(',') + indent + ']'
73461
72430
  } else {
73462
- return buf.readUInt16BE(i * indexSize)
73463
- }
73464
- }
73465
-
73466
- var i;
73467
- if (dir) {
73468
- var foundIndex = -1;
73469
- for (i = byteOffset; i < arrLength; i++) {
73470
- if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
73471
- if (foundIndex === -1) foundIndex = i;
73472
- if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
73473
- } else {
73474
- if (foundIndex !== -1) i -= i - foundIndex;
73475
- foundIndex = -1;
73476
- }
73477
- }
73478
- } else {
73479
- if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
73480
- for (i = byteOffset; i >= 0; i--) {
73481
- var found = true;
73482
- for (var j = 0; j < valLength; j++) {
73483
- if (read(arr, i + j) !== read(val, j)) {
73484
- found = false;
73485
- break
72431
+ if (cycles) {
72432
+ if (seen.indexOf(node) !== -1) {
72433
+ return stringify('[Circular]')
72434
+ } else {
72435
+ seen.push(node);
73486
72436
  }
73487
72437
  }
73488
- if (found) return i
73489
- }
73490
- }
73491
-
73492
- return -1
73493
- }
73494
-
73495
- Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
73496
- return this.indexOf(val, byteOffset, encoding) !== -1
73497
- };
73498
-
73499
- Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
73500
- return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
73501
- };
73502
-
73503
- Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
73504
- return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
73505
- };
73506
-
73507
- function hexWrite (buf, string, offset, length) {
73508
- offset = Number(offset) || 0;
73509
- var remaining = buf.length - offset;
73510
- if (!length) {
73511
- length = remaining;
73512
- } else {
73513
- length = Number(length);
73514
- if (length > remaining) {
73515
- length = remaining;
73516
- }
73517
- }
73518
-
73519
- // must be an even number of digits
73520
- var strLen = string.length;
73521
- if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
73522
-
73523
- if (length > strLen / 2) {
73524
- length = strLen / 2;
73525
- }
73526
- for (var i = 0; i < length; ++i) {
73527
- var parsed = parseInt(string.substr(i * 2, 2), 16);
73528
- if (isNaN(parsed)) return i
73529
- buf[offset + i] = parsed;
73530
- }
73531
- return i
73532
- }
73533
-
73534
- function utf8Write (buf, string, offset, length) {
73535
- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
73536
- }
73537
-
73538
- function asciiWrite (buf, string, offset, length) {
73539
- return blitBuffer(asciiToBytes(string), buf, offset, length)
73540
- }
73541
-
73542
- function latin1Write (buf, string, offset, length) {
73543
- return asciiWrite(buf, string, offset, length)
73544
- }
73545
-
73546
- function base64Write (buf, string, offset, length) {
73547
- return blitBuffer(base64ToBytes(string), buf, offset, length)
73548
- }
73549
-
73550
- function ucs2Write (buf, string, offset, length) {
73551
- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
73552
- }
73553
-
73554
- Buffer.prototype.write = function write (string, offset, length, encoding) {
73555
- // Buffer#write(string)
73556
- if (offset === undefined) {
73557
- encoding = 'utf8';
73558
- length = this.length;
73559
- offset = 0;
73560
- // Buffer#write(string, encoding)
73561
- } else if (length === undefined && typeof offset === 'string') {
73562
- encoding = offset;
73563
- length = this.length;
73564
- offset = 0;
73565
- // Buffer#write(string, offset[, length][, encoding])
73566
- } else if (isFinite(offset)) {
73567
- offset = offset | 0;
73568
- if (isFinite(length)) {
73569
- length = length | 0;
73570
- if (encoding === undefined) encoding = 'utf8';
73571
- } else {
73572
- encoding = length;
73573
- length = undefined;
73574
- }
73575
- // legacy write(string, encoding, offset, length) - remove in v0.13
73576
- } else {
73577
- throw new Error(
73578
- 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
73579
- )
73580
- }
73581
-
73582
- var remaining = this.length - offset;
73583
- if (length === undefined || length > remaining) length = remaining;
73584
-
73585
- if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
73586
- throw new RangeError('Attempt to write outside buffer bounds')
73587
- }
73588
-
73589
- if (!encoding) encoding = 'utf8';
73590
-
73591
- var loweredCase = false;
73592
- for (;;) {
73593
- switch (encoding) {
73594
- case 'hex':
73595
- return hexWrite(this, string, offset, length)
73596
-
73597
- case 'utf8':
73598
- case 'utf-8':
73599
- return utf8Write(this, string, offset, length)
73600
-
73601
- case 'ascii':
73602
- return asciiWrite(this, string, offset, length)
73603
-
73604
- case 'latin1':
73605
- case 'binary':
73606
- return latin1Write(this, string, offset, length)
73607
-
73608
- case 'base64':
73609
- // Warning: maxLength not taken into account in base64Write
73610
- return base64Write(this, string, offset, length)
73611
-
73612
- case 'ucs2':
73613
- case 'ucs-2':
73614
- case 'utf16le':
73615
- case 'utf-16le':
73616
- return ucs2Write(this, string, offset, length)
73617
-
73618
- default:
73619
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
73620
- encoding = ('' + encoding).toLowerCase();
73621
- loweredCase = true;
73622
- }
73623
- }
73624
- };
73625
-
73626
- Buffer.prototype.toJSON = function toJSON () {
73627
- return {
73628
- type: 'Buffer',
73629
- data: Array.prototype.slice.call(this._arr || this, 0)
73630
- }
73631
- };
73632
-
73633
- function base64Slice (buf, start, end) {
73634
- if (start === 0 && end === buf.length) {
73635
- return fromByteArray(buf)
73636
- } else {
73637
- return fromByteArray(buf.slice(start, end))
73638
- }
73639
- }
73640
-
73641
- function utf8Slice (buf, start, end) {
73642
- end = Math.min(buf.length, end);
73643
- var res = [];
73644
-
73645
- var i = start;
73646
- while (i < end) {
73647
- var firstByte = buf[i];
73648
- var codePoint = null;
73649
- var bytesPerSequence = (firstByte > 0xEF) ? 4
73650
- : (firstByte > 0xDF) ? 3
73651
- : (firstByte > 0xBF) ? 2
73652
- : 1;
73653
-
73654
- if (i + bytesPerSequence <= end) {
73655
- var secondByte, thirdByte, fourthByte, tempCodePoint;
73656
-
73657
- switch (bytesPerSequence) {
73658
- case 1:
73659
- if (firstByte < 0x80) {
73660
- codePoint = firstByte;
73661
- }
73662
- break
73663
- case 2:
73664
- secondByte = buf[i + 1];
73665
- if ((secondByte & 0xC0) === 0x80) {
73666
- tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F);
73667
- if (tempCodePoint > 0x7F) {
73668
- codePoint = tempCodePoint;
73669
- }
73670
- }
73671
- break
73672
- case 3:
73673
- secondByte = buf[i + 1];
73674
- thirdByte = buf[i + 2];
73675
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
73676
- tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F);
73677
- if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
73678
- codePoint = tempCodePoint;
73679
- }
73680
- }
73681
- break
73682
- case 4:
73683
- secondByte = buf[i + 1];
73684
- thirdByte = buf[i + 2];
73685
- fourthByte = buf[i + 3];
73686
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
73687
- tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F);
73688
- if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
73689
- codePoint = tempCodePoint;
73690
- }
73691
- }
73692
- }
73693
- }
73694
-
73695
- if (codePoint === null) {
73696
- // we did not generate a valid codePoint so insert a
73697
- // replacement char (U+FFFD) and advance only 1 byte
73698
- codePoint = 0xFFFD;
73699
- bytesPerSequence = 1;
73700
- } else if (codePoint > 0xFFFF) {
73701
- // encode to utf16 (surrogate pair dance)
73702
- codePoint -= 0x10000;
73703
- res.push(codePoint >>> 10 & 0x3FF | 0xD800);
73704
- codePoint = 0xDC00 | codePoint & 0x3FF;
73705
- }
73706
-
73707
- res.push(codePoint);
73708
- i += bytesPerSequence;
73709
- }
73710
-
73711
- return decodeCodePointsArray(res)
73712
- }
73713
-
73714
- // Based on http://stackoverflow.com/a/22747272/680742, the browser with
73715
- // the lowest limit is Chrome, with 0x10000 args.
73716
- // We go 1 magnitude less, for safety
73717
- var MAX_ARGUMENTS_LENGTH = 0x1000;
73718
-
73719
- function decodeCodePointsArray (codePoints) {
73720
- var len = codePoints.length;
73721
- if (len <= MAX_ARGUMENTS_LENGTH) {
73722
- return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
73723
- }
73724
-
73725
- // Decode in chunks to avoid "call stack size exceeded".
73726
- var res = '';
73727
- var i = 0;
73728
- while (i < len) {
73729
- res += String.fromCharCode.apply(
73730
- String,
73731
- codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
73732
- );
73733
- }
73734
- return res
73735
- }
73736
-
73737
- function asciiSlice (buf, start, end) {
73738
- var ret = '';
73739
- end = Math.min(buf.length, end);
73740
-
73741
- for (var i = start; i < end; ++i) {
73742
- ret += String.fromCharCode(buf[i] & 0x7F);
73743
- }
73744
- return ret
73745
- }
73746
-
73747
- function latin1Slice (buf, start, end) {
73748
- var ret = '';
73749
- end = Math.min(buf.length, end);
73750
-
73751
- for (var i = start; i < end; ++i) {
73752
- ret += String.fromCharCode(buf[i]);
73753
- }
73754
- return ret
73755
- }
73756
-
73757
- function hexSlice (buf, start, end) {
73758
- var len = buf.length;
73759
-
73760
- if (!start || start < 0) start = 0;
73761
- if (!end || end < 0 || end > len) end = len;
73762
-
73763
- var out = '';
73764
- for (var i = start; i < end; ++i) {
73765
- out += toHex(buf[i]);
73766
- }
73767
- return out
73768
- }
73769
-
73770
- function utf16leSlice (buf, start, end) {
73771
- var bytes = buf.slice(start, end);
73772
- var res = '';
73773
- for (var i = 0; i < bytes.length; i += 2) {
73774
- res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
73775
- }
73776
- return res
73777
- }
73778
-
73779
- Buffer.prototype.slice = function slice (start, end) {
73780
- var len = this.length;
73781
- start = ~~start;
73782
- end = end === undefined ? len : ~~end;
73783
-
73784
- if (start < 0) {
73785
- start += len;
73786
- if (start < 0) start = 0;
73787
- } else if (start > len) {
73788
- start = len;
73789
- }
73790
-
73791
- if (end < 0) {
73792
- end += len;
73793
- if (end < 0) end = 0;
73794
- } else if (end > len) {
73795
- end = len;
73796
- }
73797
-
73798
- if (end < start) end = start;
73799
-
73800
- var newBuf;
73801
- if (Buffer.TYPED_ARRAY_SUPPORT) {
73802
- newBuf = this.subarray(start, end);
73803
- newBuf.__proto__ = Buffer.prototype;
73804
- } else {
73805
- var sliceLen = end - start;
73806
- newBuf = new Buffer(sliceLen, undefined);
73807
- for (var i = 0; i < sliceLen; ++i) {
73808
- newBuf[i] = this[i + start];
73809
- }
73810
- }
73811
-
73812
- return newBuf
73813
- };
73814
-
73815
- /*
73816
- * Need to make sure that buffer isn't trying to write out of bounds.
73817
- */
73818
- function checkOffset (offset, ext, length) {
73819
- if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
73820
- if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
73821
- }
73822
-
73823
- Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
73824
- offset = offset | 0;
73825
- byteLength = byteLength | 0;
73826
- if (!noAssert) checkOffset(offset, byteLength, this.length);
73827
-
73828
- var val = this[offset];
73829
- var mul = 1;
73830
- var i = 0;
73831
- while (++i < byteLength && (mul *= 0x100)) {
73832
- val += this[offset + i] * mul;
73833
- }
73834
-
73835
- return val
73836
- };
73837
-
73838
- Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
73839
- offset = offset | 0;
73840
- byteLength = byteLength | 0;
73841
- if (!noAssert) {
73842
- checkOffset(offset, byteLength, this.length);
73843
- }
73844
-
73845
- var val = this[offset + --byteLength];
73846
- var mul = 1;
73847
- while (byteLength > 0 && (mul *= 0x100)) {
73848
- val += this[offset + --byteLength] * mul;
73849
- }
73850
-
73851
- return val
73852
- };
73853
72438
 
73854
- Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
73855
- if (!noAssert) checkOffset(offset, 1, this.length);
73856
- return this[offset]
73857
- };
73858
-
73859
- Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
73860
- if (!noAssert) checkOffset(offset, 2, this.length);
73861
- return this[offset] | (this[offset + 1] << 8)
73862
- };
73863
-
73864
- Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
73865
- if (!noAssert) checkOffset(offset, 2, this.length);
73866
- return (this[offset] << 8) | this[offset + 1]
73867
- };
73868
-
73869
- Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
73870
- if (!noAssert) checkOffset(offset, 4, this.length);
73871
-
73872
- return ((this[offset]) |
73873
- (this[offset + 1] << 8) |
73874
- (this[offset + 2] << 16)) +
73875
- (this[offset + 3] * 0x1000000)
73876
- };
73877
-
73878
- Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
73879
- if (!noAssert) checkOffset(offset, 4, this.length);
73880
-
73881
- return (this[offset] * 0x1000000) +
73882
- ((this[offset + 1] << 16) |
73883
- (this[offset + 2] << 8) |
73884
- this[offset + 3])
73885
- };
73886
-
73887
- Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
73888
- offset = offset | 0;
73889
- byteLength = byteLength | 0;
73890
- if (!noAssert) checkOffset(offset, byteLength, this.length);
73891
-
73892
- var val = this[offset];
73893
- var mul = 1;
73894
- var i = 0;
73895
- while (++i < byteLength && (mul *= 0x100)) {
73896
- val += this[offset + i] * mul;
73897
- }
73898
- mul *= 0x80;
72439
+ const nodeKeys = keys(node).sort(compare && compare(node));
72440
+ const out = [];
72441
+ for (let i = 0; i < nodeKeys.length; i++) {
72442
+ const key = nodeKeys[i];
72443
+ const value = _deterministic(node, key, node[key], level + 1);
73899
72444
 
73900
- if (val >= mul) val -= Math.pow(2, 8 * byteLength);
72445
+ if (!value) continue
73901
72446
 
73902
- return val
73903
- };
73904
-
73905
- Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
73906
- offset = offset | 0;
73907
- byteLength = byteLength | 0;
73908
- if (!noAssert) checkOffset(offset, byteLength, this.length);
73909
-
73910
- var i = byteLength;
73911
- var mul = 1;
73912
- var val = this[offset + --i];
73913
- while (i > 0 && (mul *= 0x100)) {
73914
- val += this[offset + --i] * mul;
73915
- }
73916
- mul *= 0x80;
73917
-
73918
- if (val >= mul) val -= Math.pow(2, 8 * byteLength);
73919
-
73920
- return val
73921
- };
73922
-
73923
- Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
73924
- if (!noAssert) checkOffset(offset, 1, this.length);
73925
- if (!(this[offset] & 0x80)) return (this[offset])
73926
- return ((0xff - this[offset] + 1) * -1)
73927
- };
73928
-
73929
- Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
73930
- if (!noAssert) checkOffset(offset, 2, this.length);
73931
- var val = this[offset] | (this[offset + 1] << 8);
73932
- return (val & 0x8000) ? val | 0xFFFF0000 : val
73933
- };
73934
-
73935
- Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
73936
- if (!noAssert) checkOffset(offset, 2, this.length);
73937
- var val = this[offset + 1] | (this[offset] << 8);
73938
- return (val & 0x8000) ? val | 0xFFFF0000 : val
73939
- };
73940
-
73941
- Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
73942
- if (!noAssert) checkOffset(offset, 4, this.length);
73943
-
73944
- return (this[offset]) |
73945
- (this[offset + 1] << 8) |
73946
- (this[offset + 2] << 16) |
73947
- (this[offset + 3] << 24)
73948
- };
73949
-
73950
- Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
73951
- if (!noAssert) checkOffset(offset, 4, this.length);
73952
-
73953
- return (this[offset] << 24) |
73954
- (this[offset + 1] << 16) |
73955
- (this[offset + 2] << 8) |
73956
- (this[offset + 3])
73957
- };
73958
-
73959
- Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
73960
- if (!noAssert) checkOffset(offset, 4, this.length);
73961
- return read(this, offset, true, 23, 4)
73962
- };
73963
-
73964
- Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
73965
- if (!noAssert) checkOffset(offset, 4, this.length);
73966
- return read(this, offset, false, 23, 4)
73967
- };
73968
-
73969
- Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
73970
- if (!noAssert) checkOffset(offset, 8, this.length);
73971
- return read(this, offset, true, 52, 8)
73972
- };
73973
-
73974
- Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
73975
- if (!noAssert) checkOffset(offset, 8, this.length);
73976
- return read(this, offset, false, 52, 8)
73977
- };
73978
-
73979
- function checkInt (buf, value, offset, ext, max, min) {
73980
- if (!internalIsBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
73981
- if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
73982
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
73983
- }
73984
-
73985
- Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
73986
- value = +value;
73987
- offset = offset | 0;
73988
- byteLength = byteLength | 0;
73989
- if (!noAssert) {
73990
- var maxBytes = Math.pow(2, 8 * byteLength) - 1;
73991
- checkInt(this, value, offset, byteLength, maxBytes, 0);
73992
- }
73993
-
73994
- var mul = 1;
73995
- var i = 0;
73996
- this[offset] = value & 0xFF;
73997
- while (++i < byteLength && (mul *= 0x100)) {
73998
- this[offset + i] = (value / mul) & 0xFF;
73999
- }
74000
-
74001
- return offset + byteLength
74002
- };
74003
-
74004
- Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
74005
- value = +value;
74006
- offset = offset | 0;
74007
- byteLength = byteLength | 0;
74008
- if (!noAssert) {
74009
- var maxBytes = Math.pow(2, 8 * byteLength) - 1;
74010
- checkInt(this, value, offset, byteLength, maxBytes, 0);
74011
- }
74012
-
74013
- var i = byteLength - 1;
74014
- var mul = 1;
74015
- this[offset + i] = value & 0xFF;
74016
- while (--i >= 0 && (mul *= 0x100)) {
74017
- this[offset + i] = (value / mul) & 0xFF;
74018
- }
74019
-
74020
- return offset + byteLength
74021
- };
74022
-
74023
- Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
74024
- value = +value;
74025
- offset = offset | 0;
74026
- if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
74027
- if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
74028
- this[offset] = (value & 0xff);
74029
- return offset + 1
74030
- };
74031
-
74032
- function objectWriteUInt16 (buf, value, offset, littleEndian) {
74033
- if (value < 0) value = 0xffff + value + 1;
74034
- for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
74035
- buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
74036
- (littleEndian ? i : 1 - i) * 8;
74037
- }
74038
- }
74039
-
74040
- Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
74041
- value = +value;
74042
- offset = offset | 0;
74043
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
74044
- if (Buffer.TYPED_ARRAY_SUPPORT) {
74045
- this[offset] = (value & 0xff);
74046
- this[offset + 1] = (value >>> 8);
74047
- } else {
74048
- objectWriteUInt16(this, value, offset, true);
74049
- }
74050
- return offset + 2
74051
- };
74052
-
74053
- Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
74054
- value = +value;
74055
- offset = offset | 0;
74056
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
74057
- if (Buffer.TYPED_ARRAY_SUPPORT) {
74058
- this[offset] = (value >>> 8);
74059
- this[offset + 1] = (value & 0xff);
74060
- } else {
74061
- objectWriteUInt16(this, value, offset, false);
74062
- }
74063
- return offset + 2
74064
- };
74065
-
74066
- function objectWriteUInt32 (buf, value, offset, littleEndian) {
74067
- if (value < 0) value = 0xffffffff + value + 1;
74068
- for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
74069
- buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff;
74070
- }
74071
- }
74072
-
74073
- Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
74074
- value = +value;
74075
- offset = offset | 0;
74076
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
74077
- if (Buffer.TYPED_ARRAY_SUPPORT) {
74078
- this[offset + 3] = (value >>> 24);
74079
- this[offset + 2] = (value >>> 16);
74080
- this[offset + 1] = (value >>> 8);
74081
- this[offset] = (value & 0xff);
74082
- } else {
74083
- objectWriteUInt32(this, value, offset, true);
74084
- }
74085
- return offset + 4
74086
- };
74087
-
74088
- Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
74089
- value = +value;
74090
- offset = offset | 0;
74091
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
74092
- if (Buffer.TYPED_ARRAY_SUPPORT) {
74093
- this[offset] = (value >>> 24);
74094
- this[offset + 1] = (value >>> 16);
74095
- this[offset + 2] = (value >>> 8);
74096
- this[offset + 3] = (value & 0xff);
74097
- } else {
74098
- objectWriteUInt32(this, value, offset, false);
74099
- }
74100
- return offset + 4
74101
- };
74102
-
74103
- Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
74104
- value = +value;
74105
- offset = offset | 0;
74106
- if (!noAssert) {
74107
- var limit = Math.pow(2, 8 * byteLength - 1);
74108
-
74109
- checkInt(this, value, offset, byteLength, limit - 1, -limit);
74110
- }
74111
-
74112
- var i = 0;
74113
- var mul = 1;
74114
- var sub = 0;
74115
- this[offset] = value & 0xFF;
74116
- while (++i < byteLength && (mul *= 0x100)) {
74117
- if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
74118
- sub = 1;
74119
- }
74120
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF;
74121
- }
74122
-
74123
- return offset + byteLength
74124
- };
74125
-
74126
- Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
74127
- value = +value;
74128
- offset = offset | 0;
74129
- if (!noAssert) {
74130
- var limit = Math.pow(2, 8 * byteLength - 1);
74131
-
74132
- checkInt(this, value, offset, byteLength, limit - 1, -limit);
74133
- }
74134
-
74135
- var i = byteLength - 1;
74136
- var mul = 1;
74137
- var sub = 0;
74138
- this[offset + i] = value & 0xFF;
74139
- while (--i >= 0 && (mul *= 0x100)) {
74140
- if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
74141
- sub = 1;
74142
- }
74143
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF;
74144
- }
74145
-
74146
- return offset + byteLength
74147
- };
74148
-
74149
- Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
74150
- value = +value;
74151
- offset = offset | 0;
74152
- if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
74153
- if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
74154
- if (value < 0) value = 0xff + value + 1;
74155
- this[offset] = (value & 0xff);
74156
- return offset + 1
74157
- };
74158
-
74159
- Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
74160
- value = +value;
74161
- offset = offset | 0;
74162
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
74163
- if (Buffer.TYPED_ARRAY_SUPPORT) {
74164
- this[offset] = (value & 0xff);
74165
- this[offset + 1] = (value >>> 8);
74166
- } else {
74167
- objectWriteUInt16(this, value, offset, true);
74168
- }
74169
- return offset + 2
74170
- };
74171
-
74172
- Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
74173
- value = +value;
74174
- offset = offset | 0;
74175
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
74176
- if (Buffer.TYPED_ARRAY_SUPPORT) {
74177
- this[offset] = (value >>> 8);
74178
- this[offset + 1] = (value & 0xff);
74179
- } else {
74180
- objectWriteUInt16(this, value, offset, false);
74181
- }
74182
- return offset + 2
74183
- };
74184
-
74185
- Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
74186
- value = +value;
74187
- offset = offset | 0;
74188
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
74189
- if (Buffer.TYPED_ARRAY_SUPPORT) {
74190
- this[offset] = (value & 0xff);
74191
- this[offset + 1] = (value >>> 8);
74192
- this[offset + 2] = (value >>> 16);
74193
- this[offset + 3] = (value >>> 24);
74194
- } else {
74195
- objectWriteUInt32(this, value, offset, true);
74196
- }
74197
- return offset + 4
74198
- };
74199
-
74200
- Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
74201
- value = +value;
74202
- offset = offset | 0;
74203
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
74204
- if (value < 0) value = 0xffffffff + value + 1;
74205
- if (Buffer.TYPED_ARRAY_SUPPORT) {
74206
- this[offset] = (value >>> 24);
74207
- this[offset + 1] = (value >>> 16);
74208
- this[offset + 2] = (value >>> 8);
74209
- this[offset + 3] = (value & 0xff);
74210
- } else {
74211
- objectWriteUInt32(this, value, offset, false);
74212
- }
74213
- return offset + 4
74214
- };
74215
-
74216
- function checkIEEE754 (buf, value, offset, ext, max, min) {
74217
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
74218
- if (offset < 0) throw new RangeError('Index out of range')
74219
- }
74220
-
74221
- function writeFloat (buf, value, offset, littleEndian, noAssert) {
74222
- if (!noAssert) {
74223
- checkIEEE754(buf, value, offset, 4);
74224
- }
74225
- write(buf, value, offset, littleEndian, 23, 4);
74226
- return offset + 4
74227
- }
74228
-
74229
- Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
74230
- return writeFloat(this, value, offset, true, noAssert)
74231
- };
74232
-
74233
- Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
74234
- return writeFloat(this, value, offset, false, noAssert)
74235
- };
74236
-
74237
- function writeDouble (buf, value, offset, littleEndian, noAssert) {
74238
- if (!noAssert) {
74239
- checkIEEE754(buf, value, offset, 8);
74240
- }
74241
- write(buf, value, offset, littleEndian, 52, 8);
74242
- return offset + 8
74243
- }
74244
-
74245
- Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
74246
- return writeDouble(this, value, offset, true, noAssert)
74247
- };
74248
-
74249
- Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
74250
- return writeDouble(this, value, offset, false, noAssert)
74251
- };
74252
-
74253
- // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
74254
- Buffer.prototype.copy = function copy (target, targetStart, start, end) {
74255
- if (!start) start = 0;
74256
- if (!end && end !== 0) end = this.length;
74257
- if (targetStart >= target.length) targetStart = target.length;
74258
- if (!targetStart) targetStart = 0;
74259
- if (end > 0 && end < start) end = start;
74260
-
74261
- // Copy 0 bytes; we're done
74262
- if (end === start) return 0
74263
- if (target.length === 0 || this.length === 0) return 0
74264
-
74265
- // Fatal error conditions
74266
- if (targetStart < 0) {
74267
- throw new RangeError('targetStart out of bounds')
74268
- }
74269
- if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
74270
- if (end < 0) throw new RangeError('sourceEnd out of bounds')
74271
-
74272
- // Are we oob?
74273
- if (end > this.length) end = this.length;
74274
- if (target.length - targetStart < end - start) {
74275
- end = target.length - targetStart + start;
74276
- }
74277
-
74278
- var len = end - start;
74279
- var i;
74280
-
74281
- if (this === target && start < targetStart && targetStart < end) {
74282
- // descending copy from end
74283
- for (i = len - 1; i >= 0; --i) {
74284
- target[i + targetStart] = this[i + start];
74285
- }
74286
- } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
74287
- // ascending copy from start
74288
- for (i = 0; i < len; ++i) {
74289
- target[i + targetStart] = this[i + start];
74290
- }
74291
- } else {
74292
- Uint8Array.prototype.set.call(
74293
- target,
74294
- this.subarray(start, start + len),
74295
- targetStart
74296
- );
74297
- }
74298
-
74299
- return len
74300
- };
74301
-
74302
- // Usage:
74303
- // buffer.fill(number[, offset[, end]])
74304
- // buffer.fill(buffer[, offset[, end]])
74305
- // buffer.fill(string[, offset[, end]][, encoding])
74306
- Buffer.prototype.fill = function fill (val, start, end, encoding) {
74307
- // Handle string cases:
74308
- if (typeof val === 'string') {
74309
- if (typeof start === 'string') {
74310
- encoding = start;
74311
- start = 0;
74312
- end = this.length;
74313
- } else if (typeof end === 'string') {
74314
- encoding = end;
74315
- end = this.length;
74316
- }
74317
- if (val.length === 1) {
74318
- var code = val.charCodeAt(0);
74319
- if (code < 256) {
74320
- val = code;
72447
+ const keyValue = stringify(key) + colonSeparator + value;
72448
+ out.push(indent + space + keyValue);
74321
72449
  }
72450
+ seen.splice(seen.indexOf(node), 1);
72451
+ return '{' + out.join(',') + indent + '}'
74322
72452
  }
74323
- if (encoding !== undefined && typeof encoding !== 'string') {
74324
- throw new TypeError('encoding must be a string')
74325
- }
74326
- if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
74327
- throw new TypeError('Unknown encoding: ' + encoding)
74328
- }
74329
- } else if (typeof val === 'number') {
74330
- val = val & 255;
74331
- }
74332
-
74333
- // Invalid ranges are not set to a default, so can range check early.
74334
- if (start < 0 || this.length < start || this.length < end) {
74335
- throw new RangeError('Out of range index')
74336
- }
74337
-
74338
- if (end <= start) {
74339
- return this
74340
- }
74341
-
74342
- start = start >>> 0;
74343
- end = end === undefined ? this.length : end >>> 0;
74344
-
74345
- if (!val) val = 0;
74346
-
74347
- var i;
74348
- if (typeof val === 'number') {
74349
- for (i = start; i < end; ++i) {
74350
- this[i] = val;
74351
- }
74352
- } else {
74353
- var bytes = internalIsBuffer(val)
74354
- ? val
74355
- : utf8ToBytes(new Buffer(val, encoding).toString());
74356
- var len = bytes.length;
74357
- for (i = 0; i < end - start; ++i) {
74358
- this[i + start] = bytes[i % len];
74359
- }
74360
- }
74361
-
74362
- return this
74363
- };
74364
-
74365
- // HELPER FUNCTIONS
74366
- // ================
74367
-
74368
- var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;
74369
-
74370
- function base64clean (str) {
74371
- // Node strips out invalid characters like \n and \t from the string, base64-js does not
74372
- str = stringtrim(str).replace(INVALID_BASE64_RE, '');
74373
- // Node converts strings with length < 2 to ''
74374
- if (str.length < 2) return ''
74375
- // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
74376
- while (str.length % 4 !== 0) {
74377
- str = str + '=';
74378
- }
74379
- return str
74380
- }
74381
-
74382
- function stringtrim (str) {
74383
- if (str.trim) return str.trim()
74384
- return str.replace(/^\s+|\s+$/g, '')
74385
- }
74386
-
74387
- function toHex (n) {
74388
- if (n < 16) return '0' + n.toString(16)
74389
- return n.toString(16)
74390
- }
74391
-
74392
- function utf8ToBytes (string, units) {
74393
- units = units || Infinity;
74394
- var codePoint;
74395
- var length = string.length;
74396
- var leadSurrogate = null;
74397
- var bytes = [];
74398
-
74399
- for (var i = 0; i < length; ++i) {
74400
- codePoint = string.charCodeAt(i);
74401
-
74402
- // is surrogate component
74403
- if (codePoint > 0xD7FF && codePoint < 0xE000) {
74404
- // last char was a lead
74405
- if (!leadSurrogate) {
74406
- // no lead yet
74407
- if (codePoint > 0xDBFF) {
74408
- // unexpected trail
74409
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
74410
- continue
74411
- } else if (i + 1 === length) {
74412
- // unpaired lead
74413
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
74414
- continue
74415
- }
74416
-
74417
- // valid lead
74418
- leadSurrogate = codePoint;
74419
-
74420
- continue
74421
- }
74422
-
74423
- // 2 leads in a row
74424
- if (codePoint < 0xDC00) {
74425
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
74426
- leadSurrogate = codePoint;
74427
- continue
74428
- }
74429
-
74430
- // valid surrogate pair
74431
- codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
74432
- } else if (leadSurrogate) {
74433
- // valid bmp char, but last char was a lead
74434
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
74435
- }
74436
-
74437
- leadSurrogate = null;
74438
-
74439
- // encode utf8
74440
- if (codePoint < 0x80) {
74441
- if ((units -= 1) < 0) break
74442
- bytes.push(codePoint);
74443
- } else if (codePoint < 0x800) {
74444
- if ((units -= 2) < 0) break
74445
- bytes.push(
74446
- codePoint >> 0x6 | 0xC0,
74447
- codePoint & 0x3F | 0x80
74448
- );
74449
- } else if (codePoint < 0x10000) {
74450
- if ((units -= 3) < 0) break
74451
- bytes.push(
74452
- codePoint >> 0xC | 0xE0,
74453
- codePoint >> 0x6 & 0x3F | 0x80,
74454
- codePoint & 0x3F | 0x80
74455
- );
74456
- } else if (codePoint < 0x110000) {
74457
- if ((units -= 4) < 0) break
74458
- bytes.push(
74459
- codePoint >> 0x12 | 0xF0,
74460
- codePoint >> 0xC & 0x3F | 0x80,
74461
- codePoint >> 0x6 & 0x3F | 0x80,
74462
- codePoint & 0x3F | 0x80
74463
- );
74464
- } else {
74465
- throw new Error('Invalid code point')
74466
- }
74467
- }
74468
-
74469
- return bytes
74470
- }
74471
-
74472
- function asciiToBytes (str) {
74473
- var byteArray = [];
74474
- for (var i = 0; i < str.length; ++i) {
74475
- // Node's code seems to be doing this and not & 0x7F..
74476
- byteArray.push(str.charCodeAt(i) & 0xFF);
74477
- }
74478
- return byteArray
74479
- }
74480
-
74481
- function utf16leToBytes (str, units) {
74482
- var c, hi, lo;
74483
- var byteArray = [];
74484
- for (var i = 0; i < str.length; ++i) {
74485
- if ((units -= 2) < 0) break
74486
-
74487
- c = str.charCodeAt(i);
74488
- hi = c >> 8;
74489
- lo = c % 256;
74490
- byteArray.push(lo);
74491
- byteArray.push(hi);
74492
- }
74493
-
74494
- return byteArray
74495
- }
74496
-
74497
-
74498
- function base64ToBytes (str) {
74499
- return toByteArray(base64clean(str))
74500
- }
74501
-
74502
- function blitBuffer (src, dst, offset, length) {
74503
- for (var i = 0; i < length; ++i) {
74504
- if ((i + offset >= dst.length) || (i >= src.length)) break
74505
- dst[i + offset] = src[i];
74506
- }
74507
- return i
74508
- }
74509
-
74510
- function isnan (val) {
74511
- return val !== val // eslint-disable-line no-self-compare
72453
+ })({ '': obj }, '', obj, 0)
74512
72454
  }
74513
72455
 
72456
+ var lib = stringifyDeterministic;
74514
72457
 
74515
- // the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence
74516
- // The _isBuffer check is for Safari 5-7 support, because it's missing
74517
- // Object.prototype.constructor. Remove this eventually
74518
- function isBuffer(obj) {
74519
- return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))
74520
- }
74521
-
74522
- function isFastBuffer (obj) {
74523
- return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
74524
- }
74525
-
74526
- // For Node v0.10 support. Remove this eventually.
74527
- function isSlowBuffer (obj) {
74528
- return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0))
74529
- }
74530
-
74531
- var objectHash$1 = {exports: {}};
74532
-
74533
- var empty = {};
74534
-
74535
- var empty$1 = /*#__PURE__*/Object.freeze({
74536
- __proto__: null,
74537
- default: empty
74538
- });
74539
-
74540
- var require$$0 = /*@__PURE__*/getAugmentedNamespace(empty$1);
74541
-
74542
- (function (module, exports) {
74543
-
74544
- var crypto = require$$0;
74545
-
74546
- /**
74547
- * Exported function
74548
- *
74549
- * Options:
74550
- *
74551
- * - `algorithm` hash algo to be used by this instance: *'sha1', 'md5'
74552
- * - `excludeValues` {true|*false} hash object keys, values ignored
74553
- * - `encoding` hash encoding, supports 'buffer', '*hex', 'binary', 'base64'
74554
- * - `ignoreUnknown` {true|*false} ignore unknown object types
74555
- * - `replacer` optional function that replaces values before hashing
74556
- * - `respectFunctionProperties` {*true|false} consider function properties when hashing
74557
- * - `respectFunctionNames` {*true|false} consider 'name' property of functions for hashing
74558
- * - `respectType` {*true|false} Respect special properties (prototype, constructor)
74559
- * when hashing to distinguish between types
74560
- * - `unorderedArrays` {true|*false} Sort all arrays before hashing
74561
- * - `unorderedSets` {*true|false} Sort `Set` and `Map` instances before hashing
74562
- * * = default
74563
- *
74564
- * @param {object} object value to hash
74565
- * @param {object} options hashing options
74566
- * @return {string} hash value
74567
- * @api public
74568
- */
74569
- exports = module.exports = objectHash;
74570
-
74571
- function objectHash(object, options){
74572
- options = applyDefaults(object, options);
74573
-
74574
- return hash(object, options);
74575
- }
74576
-
74577
- /**
74578
- * Exported sugar methods
74579
- *
74580
- * @param {object} object value to hash
74581
- * @return {string} hash value
74582
- * @api public
74583
- */
74584
- exports.sha1 = function(object){
74585
- return objectHash(object);
74586
- };
74587
- exports.keys = function(object){
74588
- return objectHash(object, {excludeValues: true, algorithm: 'sha1', encoding: 'hex'});
74589
- };
74590
- exports.MD5 = function(object){
74591
- return objectHash(object, {algorithm: 'md5', encoding: 'hex'});
74592
- };
74593
- exports.keysMD5 = function(object){
74594
- return objectHash(object, {algorithm: 'md5', encoding: 'hex', excludeValues: true});
74595
- };
74596
-
74597
- // Internals
74598
- var hashes = crypto.getHashes ? crypto.getHashes().slice() : ['sha1', 'md5'];
74599
- hashes.push('passthrough');
74600
- var encodings = ['buffer', 'hex', 'binary', 'base64'];
74601
-
74602
- function applyDefaults(object, sourceOptions){
74603
- sourceOptions = sourceOptions || {};
74604
-
74605
- // create a copy rather than mutating
74606
- var options = {};
74607
- options.algorithm = sourceOptions.algorithm || 'sha1';
74608
- options.encoding = sourceOptions.encoding || 'hex';
74609
- options.excludeValues = sourceOptions.excludeValues ? true : false;
74610
- options.algorithm = options.algorithm.toLowerCase();
74611
- options.encoding = options.encoding.toLowerCase();
74612
- options.ignoreUnknown = sourceOptions.ignoreUnknown !== true ? false : true; // default to false
74613
- options.respectType = sourceOptions.respectType === false ? false : true; // default to true
74614
- options.respectFunctionNames = sourceOptions.respectFunctionNames === false ? false : true;
74615
- options.respectFunctionProperties = sourceOptions.respectFunctionProperties === false ? false : true;
74616
- options.unorderedArrays = sourceOptions.unorderedArrays !== true ? false : true; // default to false
74617
- options.unorderedSets = sourceOptions.unorderedSets === false ? false : true; // default to false
74618
- options.unorderedObjects = sourceOptions.unorderedObjects === false ? false : true; // default to true
74619
- options.replacer = sourceOptions.replacer || undefined;
74620
- options.excludeKeys = sourceOptions.excludeKeys || undefined;
74621
-
74622
- if(typeof object === 'undefined') {
74623
- throw new Error('Object argument required.');
74624
- }
74625
-
74626
- // if there is a case-insensitive match in the hashes list, accept it
74627
- // (i.e. SHA256 for sha256)
74628
- for (var i = 0; i < hashes.length; ++i) {
74629
- if (hashes[i].toLowerCase() === options.algorithm.toLowerCase()) {
74630
- options.algorithm = hashes[i];
74631
- }
74632
- }
74633
-
74634
- if(hashes.indexOf(options.algorithm) === -1){
74635
- throw new Error('Algorithm "' + options.algorithm + '" not supported. ' +
74636
- 'supported values: ' + hashes.join(', '));
74637
- }
74638
-
74639
- if(encodings.indexOf(options.encoding) === -1 &&
74640
- options.algorithm !== 'passthrough'){
74641
- throw new Error('Encoding "' + options.encoding + '" not supported. ' +
74642
- 'supported values: ' + encodings.join(', '));
74643
- }
74644
-
74645
- return options;
74646
- }
74647
-
74648
- /** Check if the given function is a native function */
74649
- function isNativeFunction(f) {
74650
- if ((typeof f) !== 'function') {
74651
- return false;
74652
- }
74653
- var exp = /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;
74654
- return exp.exec(Function.prototype.toString.call(f)) != null;
74655
- }
74656
-
74657
- function hash(object, options) {
74658
- var hashingStream;
74659
-
74660
- if (options.algorithm !== 'passthrough') {
74661
- hashingStream = crypto.createHash(options.algorithm);
74662
- } else {
74663
- hashingStream = new PassThrough();
74664
- }
74665
-
74666
- if (typeof hashingStream.write === 'undefined') {
74667
- hashingStream.write = hashingStream.update;
74668
- hashingStream.end = hashingStream.update;
74669
- }
74670
-
74671
- var hasher = typeHasher(options, hashingStream);
74672
- hasher.dispatch(object);
74673
- if (!hashingStream.update) {
74674
- hashingStream.end('');
74675
- }
74676
-
74677
- if (hashingStream.digest) {
74678
- return hashingStream.digest(options.encoding === 'buffer' ? undefined : options.encoding);
74679
- }
74680
-
74681
- var buf = hashingStream.read();
74682
- if (options.encoding === 'buffer') {
74683
- return buf;
74684
- }
74685
-
74686
- return buf.toString(options.encoding);
74687
- }
74688
-
74689
- /**
74690
- * Expose streaming API
74691
- *
74692
- * @param {object} object Value to serialize
74693
- * @param {object} options Options, as for hash()
74694
- * @param {object} stream A stream to write the serializiation to
74695
- * @api public
74696
- */
74697
- exports.writeToStream = function(object, options, stream) {
74698
- if (typeof stream === 'undefined') {
74699
- stream = options;
74700
- options = {};
74701
- }
74702
-
74703
- options = applyDefaults(object, options);
74704
-
74705
- return typeHasher(options, stream).dispatch(object);
74706
- };
74707
-
74708
- function typeHasher(options, writeTo, context){
74709
- context = context || [];
74710
- var write = function(str) {
74711
- if (writeTo.update) {
74712
- return writeTo.update(str, 'utf8');
74713
- } else {
74714
- return writeTo.write(str, 'utf8');
74715
- }
74716
- };
74717
-
74718
- return {
74719
- dispatch: function(value){
74720
- if (options.replacer) {
74721
- value = options.replacer(value);
74722
- }
74723
-
74724
- var type = typeof value;
74725
- if (value === null) {
74726
- type = 'null';
74727
- }
74728
-
74729
- //console.log("[DEBUG] Dispatch: ", value, "->", type, " -> ", "_" + type);
74730
-
74731
- return this['_' + type](value);
74732
- },
74733
- _object: function(object) {
74734
- var pattern = (/\[object (.*)\]/i);
74735
- var objString = Object.prototype.toString.call(object);
74736
- var objType = pattern.exec(objString);
74737
- if (!objType) { // object type did not match [object ...]
74738
- objType = 'unknown:[' + objString + ']';
74739
- } else {
74740
- objType = objType[1]; // take only the class name
74741
- }
74742
-
74743
- objType = objType.toLowerCase();
74744
-
74745
- var objectNumber = null;
74746
-
74747
- if ((objectNumber = context.indexOf(object)) >= 0) {
74748
- return this.dispatch('[CIRCULAR:' + objectNumber + ']');
74749
- } else {
74750
- context.push(object);
74751
- }
74752
-
74753
- if (typeof Buffer !== 'undefined' && Buffer.isBuffer && Buffer.isBuffer(object)) {
74754
- write('buffer:');
74755
- return write(object);
74756
- }
74757
-
74758
- if(objType !== 'object' && objType !== 'function' && objType !== 'asyncfunction') {
74759
- if(this['_' + objType]) {
74760
- this['_' + objType](object);
74761
- } else if (options.ignoreUnknown) {
74762
- return write('[' + objType + ']');
74763
- } else {
74764
- throw new Error('Unknown object type "' + objType + '"');
74765
- }
74766
- }else {
74767
- var keys = Object.keys(object);
74768
- if (options.unorderedObjects) {
74769
- keys = keys.sort();
74770
- }
74771
- // Make sure to incorporate special properties, so
74772
- // Types with different prototypes will produce
74773
- // a different hash and objects derived from
74774
- // different functions (`new Foo`, `new Bar`) will
74775
- // produce different hashes.
74776
- // We never do this for native functions since some
74777
- // seem to break because of that.
74778
- if (options.respectType !== false && !isNativeFunction(object)) {
74779
- keys.splice(0, 0, 'prototype', '__proto__', 'constructor');
74780
- }
74781
-
74782
- if (options.excludeKeys) {
74783
- keys = keys.filter(function(key) { return !options.excludeKeys(key); });
74784
- }
74785
-
74786
- write('object:' + keys.length + ':');
74787
- var self = this;
74788
- return keys.forEach(function(key){
74789
- self.dispatch(key);
74790
- write(':');
74791
- if(!options.excludeValues) {
74792
- self.dispatch(object[key]);
74793
- }
74794
- write(',');
74795
- });
74796
- }
74797
- },
74798
- _array: function(arr, unordered){
74799
- unordered = typeof unordered !== 'undefined' ? unordered :
74800
- options.unorderedArrays !== false; // default to options.unorderedArrays
74801
-
74802
- var self = this;
74803
- write('array:' + arr.length + ':');
74804
- if (!unordered || arr.length <= 1) {
74805
- return arr.forEach(function(entry) {
74806
- return self.dispatch(entry);
74807
- });
74808
- }
74809
-
74810
- // the unordered case is a little more complicated:
74811
- // since there is no canonical ordering on objects,
74812
- // i.e. {a:1} < {a:2} and {a:1} > {a:2} are both false,
74813
- // we first serialize each entry using a PassThrough stream
74814
- // before sorting.
74815
- // also: we can’t use the same context array for all entries
74816
- // since the order of hashing should *not* matter. instead,
74817
- // we keep track of the additions to a copy of the context array
74818
- // and add all of them to the global context array when we’re done
74819
- var contextAdditions = [];
74820
- var entries = arr.map(function(entry) {
74821
- var strm = new PassThrough();
74822
- var localContext = context.slice(); // make copy
74823
- var hasher = typeHasher(options, strm, localContext);
74824
- hasher.dispatch(entry);
74825
- // take only what was added to localContext and append it to contextAdditions
74826
- contextAdditions = contextAdditions.concat(localContext.slice(context.length));
74827
- return strm.read().toString();
74828
- });
74829
- context = context.concat(contextAdditions);
74830
- entries.sort();
74831
- return this._array(entries, false);
74832
- },
74833
- _date: function(date){
74834
- return write('date:' + date.toJSON());
74835
- },
74836
- _symbol: function(sym){
74837
- return write('symbol:' + sym.toString());
74838
- },
74839
- _error: function(err){
74840
- return write('error:' + err.toString());
74841
- },
74842
- _boolean: function(bool){
74843
- return write('bool:' + bool.toString());
74844
- },
74845
- _string: function(string){
74846
- write('string:' + string.length + ':');
74847
- write(string.toString());
74848
- },
74849
- _function: function(fn){
74850
- write('fn:');
74851
- if (isNativeFunction(fn)) {
74852
- this.dispatch('[native]');
74853
- } else {
74854
- this.dispatch(fn.toString());
74855
- }
74856
-
74857
- if (options.respectFunctionNames !== false) {
74858
- // Make sure we can still distinguish native functions
74859
- // by their name, otherwise String and Function will
74860
- // have the same hash
74861
- this.dispatch("function-name:" + String(fn.name));
74862
- }
74863
-
74864
- if (options.respectFunctionProperties) {
74865
- this._object(fn);
74866
- }
74867
- },
74868
- _number: function(number){
74869
- return write('number:' + number.toString());
74870
- },
74871
- _xml: function(xml){
74872
- return write('xml:' + xml.toString());
74873
- },
74874
- _null: function() {
74875
- return write('Null');
74876
- },
74877
- _undefined: function() {
74878
- return write('Undefined');
74879
- },
74880
- _regexp: function(regex){
74881
- return write('regex:' + regex.toString());
74882
- },
74883
- _uint8array: function(arr){
74884
- write('uint8array:');
74885
- return this.dispatch(Array.prototype.slice.call(arr));
74886
- },
74887
- _uint8clampedarray: function(arr){
74888
- write('uint8clampedarray:');
74889
- return this.dispatch(Array.prototype.slice.call(arr));
74890
- },
74891
- _int8array: function(arr){
74892
- write('int8array:');
74893
- return this.dispatch(Array.prototype.slice.call(arr));
74894
- },
74895
- _uint16array: function(arr){
74896
- write('uint16array:');
74897
- return this.dispatch(Array.prototype.slice.call(arr));
74898
- },
74899
- _int16array: function(arr){
74900
- write('int16array:');
74901
- return this.dispatch(Array.prototype.slice.call(arr));
74902
- },
74903
- _uint32array: function(arr){
74904
- write('uint32array:');
74905
- return this.dispatch(Array.prototype.slice.call(arr));
74906
- },
74907
- _int32array: function(arr){
74908
- write('int32array:');
74909
- return this.dispatch(Array.prototype.slice.call(arr));
74910
- },
74911
- _float32array: function(arr){
74912
- write('float32array:');
74913
- return this.dispatch(Array.prototype.slice.call(arr));
74914
- },
74915
- _float64array: function(arr){
74916
- write('float64array:');
74917
- return this.dispatch(Array.prototype.slice.call(arr));
74918
- },
74919
- _arraybuffer: function(arr){
74920
- write('arraybuffer:');
74921
- return this.dispatch(new Uint8Array(arr));
74922
- },
74923
- _url: function(url) {
74924
- return write('url:' + url.toString());
74925
- },
74926
- _map: function(map) {
74927
- write('map:');
74928
- var arr = Array.from(map);
74929
- return this._array(arr, options.unorderedSets !== false);
74930
- },
74931
- _set: function(set) {
74932
- write('set:');
74933
- var arr = Array.from(set);
74934
- return this._array(arr, options.unorderedSets !== false);
74935
- },
74936
- _file: function(file) {
74937
- write('file:');
74938
- return this.dispatch([file.name, file.size, file.type, file.lastModfied]);
74939
- },
74940
- _blob: function() {
74941
- if (options.ignoreUnknown) {
74942
- return write('[blob]');
74943
- }
74944
-
74945
- throw Error('Hashing Blob objects is currently not supported\n' +
74946
- '(see https://github.com/puleos/object-hash/issues/26)\n' +
74947
- 'Use "options.replacer" or "options.ignoreUnknown"\n');
74948
- },
74949
- _domwindow: function() { return write('domwindow'); },
74950
- _bigint: function(number){
74951
- return write('bigint:' + number.toString());
74952
- },
74953
- /* Node.js standard native objects */
74954
- _process: function() { return write('process'); },
74955
- _timer: function() { return write('timer'); },
74956
- _pipe: function() { return write('pipe'); },
74957
- _tcp: function() { return write('tcp'); },
74958
- _udp: function() { return write('udp'); },
74959
- _tty: function() { return write('tty'); },
74960
- _statwatcher: function() { return write('statwatcher'); },
74961
- _securecontext: function() { return write('securecontext'); },
74962
- _connection: function() { return write('connection'); },
74963
- _zlib: function() { return write('zlib'); },
74964
- _context: function() { return write('context'); },
74965
- _nodescript: function() { return write('nodescript'); },
74966
- _httpparser: function() { return write('httpparser'); },
74967
- _dataview: function() { return write('dataview'); },
74968
- _signal: function() { return write('signal'); },
74969
- _fsevent: function() { return write('fsevent'); },
74970
- _tlswrap: function() { return write('tlswrap'); },
74971
- };
74972
- }
74973
-
74974
- // Mini-implementation of stream.PassThrough
74975
- // We are far from having need for the full implementation, and we can
74976
- // make assumptions like "many writes, then only one final read"
74977
- // and we can ignore encoding specifics
74978
- function PassThrough() {
74979
- return {
74980
- buf: '',
74981
-
74982
- write: function(b) {
74983
- this.buf += b;
74984
- },
74985
-
74986
- end: function(b) {
74987
- this.buf += b;
74988
- },
74989
-
74990
- read: function() {
74991
- return this.buf;
74992
- }
74993
- };
74994
- }
74995
- } (objectHash$1, objectHash$1.exports));
74996
-
74997
- var objectHashExports = objectHash$1.exports;
74998
- var objectHash = /*@__PURE__*/getDefaultExportFromCjs(objectHashExports);
72458
+ var jsonStringifyDeterministic = /*@__PURE__*/getDefaultExportFromCjs(lib);
74999
72459
 
72460
+ /* eslint-disable no-bitwise */ // We use the growing `json-stringify-deterministic` library rather than the `json-stable-stringify` one because:
72461
+ // https://www.npmjs.com/package/json-stringify-deterministic#json-stringify-deterministic
75000
72462
  /**
75001
- * Generates a simple hash from a collection regardless of order.
72463
+ * Generates a deterministic hash from a collection, regardless of items and props order.
72464
+ *
72465
+ * @description
72466
+ * The function converts the collection into a deterministic string representation (JSON)
72467
+ * to generate a deterministic hash for that string.
72468
+ *
72469
+ * Note: This hash is designed for simplicity and speed, it can't be used for cryptographic security.
75002
72470
  *
75003
72471
  * @param collection An array of objects
75004
72472
  * @returns A hash string representation of the collection
75005
72473
  */ function getHashFromCollection(collection) {
75006
- return objectHash(collection, {
75007
- // The name of this option is misleading:
75008
- // `true` ensures that the same hash is returned regardless of collection order
75009
- // https://github.com/puleos/object-hash#hashvalue-options
75010
- // eslint-disable-next-line @typescript-eslint/naming-convention
75011
- unorderedArrays: true
75012
- });
72474
+ // If the collection is empty, simply return "0"
72475
+ if (collection.length === 0) {
72476
+ return '0';
72477
+ }
72478
+ // An order-independent string representation of the collection
72479
+ const collectionAsDeterministicJson = `[${collection.map((collectionItem)=>jsonStringifyDeterministic(collectionItem)).sort().join(',')}]`;
72480
+ // Initialize hash value
72481
+ let hashAsNumber = 0;
72482
+ let characterAsUnicodeValue;
72483
+ // Iterate over each character in the string representation of the collection
72484
+ for(let index = 0; index < collectionAsDeterministicJson.length; index += 1){
72485
+ characterAsUnicodeValue = collectionAsDeterministicJson.charCodeAt(index);
72486
+ // Modify the hash value based on the current character's code.
72487
+ // The operation `(hashAsNumber << 5) - hashAsNumber` rapidly increases the hash value,
72488
+ // and adding the character code `+ characterAsUnicodeValue` further modifies it.
72489
+ // This produces a wide range of hash values for different inputs.
72490
+ hashAsNumber = (hashAsNumber << 5) - hashAsNumber + characterAsUnicodeValue;
72491
+ // This operation ensures we get a 32-bit integer, effectively wrapping the hash value if it exceeds 32 bit
72492
+ hashAsNumber |= 0;
72493
+ }
72494
+ return hashAsNumber.toString();
75013
72495
  }
75014
72496
 
75015
72497
  /**