data-structure-typed 2.1.1 → 2.1.2

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +19 -7
  3. package/dist/cjs/index.cjs +22 -22
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/esm/index.mjs +22 -22
  6. package/dist/esm/index.mjs.map +1 -1
  7. package/dist/types/data-structures/binary-tree/avl-tree-counter.d.ts +1 -1
  8. package/dist/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +1 -1
  9. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +1 -1
  10. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +1 -1
  11. package/dist/types/data-structures/binary-tree/bst.d.ts +1 -1
  12. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +2 -2
  13. package/dist/types/data-structures/binary-tree/tree-counter.d.ts +1 -1
  14. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +1 -1
  15. package/dist/types/data-structures/heap/heap.d.ts +4 -4
  16. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +1 -1
  17. package/dist/types/interfaces/binary-tree.d.ts +1 -1
  18. package/dist/umd/data-structure-typed.js +87 -165
  19. package/dist/umd/data-structure-typed.js.map +1 -1
  20. package/dist/umd/data-structure-typed.min.js +2 -2
  21. package/dist/umd/data-structure-typed.min.js.map +1 -1
  22. package/jest.integration.config.js +7 -3
  23. package/package.json +11 -7
  24. package/src/data-structures/binary-tree/avl-tree-counter.ts +4 -4
  25. package/src/data-structures/binary-tree/avl-tree-multi-map.ts +1 -1
  26. package/src/data-structures/binary-tree/avl-tree.ts +2 -2
  27. package/src/data-structures/binary-tree/binary-tree.ts +4 -4
  28. package/src/data-structures/binary-tree/bst.ts +1 -1
  29. package/src/data-structures/binary-tree/red-black-tree.ts +2 -2
  30. package/src/data-structures/binary-tree/tree-counter.ts +4 -4
  31. package/src/data-structures/binary-tree/tree-multi-map.ts +1 -1
  32. package/src/data-structures/heap/heap.ts +5 -5
  33. package/src/data-structures/linked-list/singly-linked-list.ts +2 -2
  34. package/src/interfaces/binary-tree.ts +1 -1
  35. package/test/integration/compile.test.mjs +159 -0
  36. package/test/integration/compile.test.ts +176 -0
  37. package/test/integration/heap.test.js +1 -1
  38. package/test/integration/index.html +1 -1
  39. package/test/unit/data-structures/binary-tree/binary-tree.test.ts +3 -3
  40. package/{tsconfig-base.json → tsconfig.base.json} +0 -1
  41. package/tsconfig.test.json +1 -0
  42. package/{tsconfig-types.json → tsconfig.types.json} +1 -3
  43. package/tsup.config.js +2 -3
  44. package/dist/index.cjs +0 -13091
  45. package/dist/index.cjs.map +0 -1
  46. package/dist/index.js +0 -13013
  47. package/dist/index.js.map +0 -1
  48. package/test/integration/compile.js +0 -144
  49. package/test/integration/compile.mjs +0 -135
  50. package/test/integration/compile.ts +0 -171
  51. /package/{tsup.node.config.ts → tsup.node.config.js} +0 -0
@@ -1,42 +1,10 @@
1
1
  "use strict";
2
2
  var dataStructureTyped = (() => {
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
- var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
12
- var __typeError = (msg) => {
13
- throw TypeError(msg);
14
- };
15
7
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16
- var __spreadValues = (a, b) => {
17
- for (var prop in b || (b = {}))
18
- if (__hasOwnProp.call(b, prop))
19
- __defNormalProp(a, prop, b[prop]);
20
- if (__getOwnPropSymbols)
21
- for (var prop of __getOwnPropSymbols(b)) {
22
- if (__propIsEnum.call(b, prop))
23
- __defNormalProp(a, prop, b[prop]);
24
- }
25
- return a;
26
- };
27
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
- var __objRest = (source, exclude) => {
29
- var target = {};
30
- for (var prop in source)
31
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
32
- target[prop] = source[prop];
33
- if (source != null && __getOwnPropSymbols)
34
- for (var prop of __getOwnPropSymbols(source)) {
35
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
36
- target[prop] = source[prop];
37
- }
38
- return target;
39
- };
40
8
  var __export = (target, all) => {
41
9
  for (var name in all)
42
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -51,58 +19,6 @@ var dataStructureTyped = (() => {
51
19
  };
52
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
53
21
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
54
- var __async = (__this, __arguments, generator) => {
55
- return new Promise((resolve, reject) => {
56
- var fulfilled = (value) => {
57
- try {
58
- step(generator.next(value));
59
- } catch (e) {
60
- reject(e);
61
- }
62
- };
63
- var rejected = (value) => {
64
- try {
65
- step(generator.throw(value));
66
- } catch (e) {
67
- reject(e);
68
- }
69
- };
70
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
71
- step((generator = generator.apply(__this, __arguments)).next());
72
- });
73
- };
74
- var __await = function(promise, isYieldStar) {
75
- this[0] = promise;
76
- this[1] = isYieldStar;
77
- };
78
- var __yieldStar = (value) => {
79
- var obj = value[__knownSymbol("asyncIterator")], isAwait = false, method, it = {};
80
- if (obj == null) {
81
- obj = value[__knownSymbol("iterator")]();
82
- method = (k) => it[k] = (x) => obj[k](x);
83
- } else {
84
- obj = obj.call(value);
85
- method = (k) => it[k] = (v) => {
86
- if (isAwait) {
87
- isAwait = false;
88
- if (k === "throw") throw v;
89
- return v;
90
- }
91
- isAwait = true;
92
- return {
93
- done: false,
94
- value: new __await(new Promise((resolve) => {
95
- var x = obj[k](v);
96
- if (!(x instanceof Object)) __typeError("Object expected");
97
- resolve(x);
98
- }), 1)
99
- };
100
- };
101
- }
102
- return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x) => {
103
- throw x;
104
- }, "return" in obj && method("return"), it;
105
- };
106
22
 
107
23
  // src/index.ts
108
24
  var src_exports = {};
@@ -194,7 +110,7 @@ var dataStructureTyped = (() => {
194
110
  * @remarks Time O(n) to iterate, Space O(1)
195
111
  */
196
112
  *[Symbol.iterator](...args) {
197
- yield* __yieldStar(this._getIterator(...args));
113
+ yield* this._getIterator(...args);
198
114
  }
199
115
  /**
200
116
  * Iterate over `[key, value]` pairs (may yield `undefined` values).
@@ -402,7 +318,7 @@ var dataStructureTyped = (() => {
402
318
  * Producing the iterator is O(1); consuming the entire iterator is Time O(n) with O(1) extra space.
403
319
  */
404
320
  *[Symbol.iterator](...args) {
405
- yield* __yieldStar(this._getIterator(...args));
321
+ yield* this._getIterator(...args);
406
322
  }
407
323
  /**
408
324
  * Returns an iterator over the values (alias of the default iterator).
@@ -667,19 +583,17 @@ var dataStructureTyped = (() => {
667
583
  function makeTrampoline(fn) {
668
584
  return (...args) => trampoline(fn(...args));
669
585
  }
670
- function asyncTrampoline(initial) {
671
- return __async(this, null, function* () {
672
- let current = yield initial;
673
- while (isTrampolineThunk(current)) {
674
- current = yield current.fn();
675
- }
676
- return current;
677
- });
586
+ async function asyncTrampoline(initial) {
587
+ let current = await initial;
588
+ while (isTrampolineThunk(current)) {
589
+ current = await current.fn();
590
+ }
591
+ return current;
678
592
  }
679
593
  function makeAsyncTrampoline(fn) {
680
- return (...args) => __async(null, null, function* () {
594
+ return async (...args) => {
681
595
  return asyncTrampoline(fn(...args));
682
- });
596
+ };
683
597
  }
684
598
 
685
599
  // src/utils/number.ts
@@ -2207,7 +2121,7 @@ var dataStructureTyped = (() => {
2207
2121
  * @returns A new SinglyLinkedList with mapped values.
2208
2122
  */
2209
2123
  map(callback, options, thisArg) {
2210
- const out = this._createLike([], __spreadProps(__spreadValues({}, options != null ? options : {}), { maxLen: this._maxLen }));
2124
+ const out = this._createLike([], { ...options != null ? options : {}, maxLen: this._maxLen });
2211
2125
  let index = 0;
2212
2126
  for (const value of this) out.push(callback.call(thisArg, value, index++, this));
2213
2127
  return out;
@@ -2218,7 +2132,7 @@ var dataStructureTyped = (() => {
2218
2132
  * @param value - Value to wrap in a node.
2219
2133
  * @returns A new SinglyLinkedListNode instance.
2220
2134
  */
2221
- _createNode(value) {
2135
+ createNode(value) {
2222
2136
  return new SinglyLinkedListNode(value);
2223
2137
  }
2224
2138
  /**
@@ -2238,7 +2152,7 @@ var dataStructureTyped = (() => {
2238
2152
  */
2239
2153
  _ensureNode(elementOrNode) {
2240
2154
  if (this.isNode(elementOrNode)) return elementOrNode;
2241
- return this._createNode(elementOrNode);
2155
+ return this.createNode(elementOrNode);
2242
2156
  }
2243
2157
  /**
2244
2158
  * (Protected) Normalize input into a node predicate.
@@ -2867,7 +2781,7 @@ var dataStructureTyped = (() => {
2867
2781
  * @returns A new DoublyLinkedList with mapped values.
2868
2782
  */
2869
2783
  map(callback, options, thisArg) {
2870
- const out = this._createLike([], __spreadProps(__spreadValues({}, options != null ? options : {}), { maxLen: this._maxLen }));
2784
+ const out = this._createLike([], { ...options != null ? options : {}, maxLen: this._maxLen });
2871
2785
  let index = 0;
2872
2786
  for (const v of this) out.push(callback.call(thisArg, v, index++, this));
2873
2787
  return out;
@@ -3284,7 +3198,7 @@ var dataStructureTyped = (() => {
3284
3198
  * @returns A new Stack with mapped elements.
3285
3199
  */
3286
3200
  map(callback, options, thisArg) {
3287
- const out = this._createLike([], __spreadValues({}, options != null ? options : {}));
3201
+ const out = this._createLike([], { ...options != null ? options : {} });
3288
3202
  let index = 0;
3289
3203
  for (const v of this) {
3290
3204
  out.push(thisArg === void 0 ? callback(v, index, this) : callback.call(thisArg, v, index, this));
@@ -4333,10 +4247,11 @@ var dataStructureTyped = (() => {
4333
4247
  * @returns A new Deque with mapped elements.
4334
4248
  */
4335
4249
  map(callback, options, thisArg) {
4336
- const out = this._createLike([], __spreadProps(__spreadValues({}, options != null ? options : {}), {
4250
+ const out = this._createLike([], {
4251
+ ...options != null ? options : {},
4337
4252
  bucketSize: this._bucketSize,
4338
4253
  maxLen: this._maxLen
4339
- }));
4254
+ });
4340
4255
  let index = 0;
4341
4256
  for (const el of this) {
4342
4257
  const mv = thisArg === void 0 ? callback(el, index, this) : callback.call(thisArg, el, index, this);
@@ -4772,9 +4687,9 @@ var dataStructureTyped = (() => {
4772
4687
  * @returns A new heap with mapped elements.
4773
4688
  */
4774
4689
  map(callback, options, thisArg) {
4775
- const _a = options != null ? options : {}, { comparator, toElementFn } = _a, rest = __objRest(_a, ["comparator", "toElementFn"]);
4690
+ const { comparator, toElementFn, ...rest } = options != null ? options : {};
4776
4691
  if (!comparator) throw new TypeError("Heap.map requires options.comparator for EM");
4777
- const out = this._createLike([], __spreadProps(__spreadValues({}, rest), { comparator, toElementFn }));
4692
+ const out = this._createLike([], { ...rest, comparator, toElementFn });
4778
4693
  let i = 0;
4779
4694
  for (const x of this) {
4780
4695
  const v = thisArg === void 0 ? callback(x, i++, this) : callback.call(thisArg, x, i++, this);
@@ -4851,7 +4766,7 @@ var dataStructureTyped = (() => {
4851
4766
  */
4852
4767
  _createInstance(options) {
4853
4768
  const Ctor = this.constructor;
4854
- const next = new Ctor([], __spreadValues({ comparator: this.comparator, toElementFn: this.toElementFn }, options != null ? options : {}));
4769
+ const next = new Ctor([], { comparator: this.comparator, toElementFn: this.toElementFn, ...options != null ? options : {} });
4855
4770
  return next;
4856
4771
  }
4857
4772
  /**
@@ -4947,7 +4862,7 @@ var dataStructureTyped = (() => {
4947
4862
  * @returns This heap.
4948
4863
  */
4949
4864
  push(element) {
4950
- const node = this._createNode(element);
4865
+ const node = this.createNode(element);
4951
4866
  node.left = node;
4952
4867
  node.right = node;
4953
4868
  this.mergeWithRoot(node);
@@ -5046,7 +4961,7 @@ var dataStructureTyped = (() => {
5046
4961
  this._size += heapToMerge.size;
5047
4962
  heapToMerge.clear();
5048
4963
  }
5049
- _createNode(element) {
4964
+ createNode(element) {
5050
4965
  return new FibonacciHeapNode(element);
5051
4966
  }
5052
4967
  isEmpty() {
@@ -5113,7 +5028,7 @@ var dataStructureTyped = (() => {
5113
5028
  * @param options Optional configuration.
5114
5029
  */
5115
5030
  constructor(elements = [], options) {
5116
- super(elements, __spreadValues({
5031
+ super(elements, {
5117
5032
  comparator: (a, b) => {
5118
5033
  if (typeof a === "object" || typeof b === "object") {
5119
5034
  throw TypeError(
@@ -5123,8 +5038,9 @@ var dataStructureTyped = (() => {
5123
5038
  if (a < b) return 1;
5124
5039
  if (a > b) return -1;
5125
5040
  return 0;
5126
- }
5127
- }, options));
5041
+ },
5042
+ ...options
5043
+ });
5128
5044
  }
5129
5045
  };
5130
5046
 
@@ -5173,7 +5089,7 @@ var dataStructureTyped = (() => {
5173
5089
  __publicField(this, "_options", { defaultEdgeWeight: 1 });
5174
5090
  __publicField(this, "_vertexMap", /* @__PURE__ */ new Map());
5175
5091
  const graph = options == null ? void 0 : options.graph;
5176
- this._options = __spreadValues({ defaultEdgeWeight: 1 }, graph != null ? graph : {});
5092
+ this._options = { defaultEdgeWeight: 1, ...graph != null ? graph : {} };
5177
5093
  }
5178
5094
  get options() {
5179
5095
  return this._options;
@@ -5867,7 +5783,7 @@ var dataStructureTyped = (() => {
5867
5783
  * @remarks Time O(1), Space O(1)
5868
5784
  */
5869
5785
  _snapshotOptions() {
5870
- return { graph: __spreadValues({}, this._options) };
5786
+ return { graph: { ...this._options } };
5871
5787
  }
5872
5788
  /**
5873
5789
  * Create an empty graph instance of the same concrete species (Directed/Undirected/etc).
@@ -5883,8 +5799,8 @@ var dataStructureTyped = (() => {
5883
5799
  const Ctor = this.constructor;
5884
5800
  const instance = new Ctor();
5885
5801
  const graph = _options == null ? void 0 : _options.graph;
5886
- if (graph) instance._options = __spreadValues(__spreadValues({}, instance._options), graph);
5887
- else instance._options = __spreadValues(__spreadValues({}, instance._options), this._options);
5802
+ if (graph) instance._options = { ...instance._options, ...graph };
5803
+ else instance._options = { ...instance._options, ...this._options };
5888
5804
  return instance;
5889
5805
  }
5890
5806
  /**
@@ -6890,7 +6806,7 @@ var dataStructureTyped = (() => {
6890
6806
  * @remarks Time O(1), Space O(1)
6891
6807
  */
6892
6808
  _snapshotOptions() {
6893
- return __spreadProps(__spreadValues({}, super._snapshotOptions()), { originCoord: this.originCoord, bottomRight: this.bottomRight });
6809
+ return { ...super._snapshotOptions(), originCoord: this.originCoord, bottomRight: this.bottomRight };
6894
6810
  }
6895
6811
  /**
6896
6812
  * Re-create a same-species MapGraph instance from snapshot options.
@@ -7171,7 +7087,7 @@ var dataStructureTyped = (() => {
7171
7087
  * @param [value] - The value for the new node (used if not in Map mode).
7172
7088
  * @returns The newly created node.
7173
7089
  */
7174
- _createNode(key, value) {
7090
+ createNode(key, value) {
7175
7091
  return new BinaryTreeNode(key, this._isMapMode ? void 0 : value);
7176
7092
  }
7177
7093
  /**
@@ -8112,7 +8028,7 @@ var dataStructureTyped = (() => {
8112
8028
  * @returns The string representation of the tree.
8113
8029
  */
8114
8030
  toVisual(startNode = this._root, options) {
8115
- const opts = __spreadValues({ isShowUndefined: false, isShowNull: true, isShowRedBlackNIL: false }, options);
8031
+ const opts = { isShowUndefined: false, isShowNull: true, isShowRedBlackNIL: false, ...options };
8116
8032
  startNode = this.ensureNode(startNode);
8117
8033
  let output = "";
8118
8034
  if (!startNode) return output;
@@ -8275,12 +8191,12 @@ var dataStructureTyped = (() => {
8275
8191
  }
8276
8192
  } else {
8277
8193
  if (node.left && this.isRealNode(node)) {
8278
- yield* __yieldStar(this[Symbol.iterator](node.left));
8194
+ yield* this[Symbol.iterator](node.left);
8279
8195
  }
8280
8196
  if (this._isMapMode) yield [node.key, this._store.get(node.key)];
8281
8197
  else yield [node.key, node.value];
8282
8198
  if (node.right && this.isRealNode(node)) {
8283
- yield* __yieldStar(this[Symbol.iterator](node.right));
8199
+ yield* this[Symbol.iterator](node.right);
8284
8200
  }
8285
8201
  }
8286
8202
  }
@@ -8309,7 +8225,7 @@ var dataStructureTyped = (() => {
8309
8225
  */
8310
8226
  _createInstance(options) {
8311
8227
  const Ctor = this.constructor;
8312
- return new Ctor([], __spreadValues(__spreadValues({}, this._snapshotOptions()), options != null ? options : {}));
8228
+ return new Ctor([], { ...this._snapshotOptions(), ...options != null ? options : {} });
8313
8229
  }
8314
8230
  /**
8315
8231
  * (Protected) Creates a new instance of the same tree constructor, potentially with different generic types.
@@ -8322,7 +8238,7 @@ var dataStructureTyped = (() => {
8322
8238
  */
8323
8239
  _createLike(iter = [], options) {
8324
8240
  const Ctor = this.constructor;
8325
- return new Ctor(iter, __spreadValues(__spreadValues({}, this._snapshotOptions()), options != null ? options : {}));
8241
+ return new Ctor(iter, { ...this._snapshotOptions(), ...options != null ? options : {} });
8326
8242
  }
8327
8243
  /**
8328
8244
  * (Protected) Converts a key, node, or entry into a standardized [node, value] tuple.
@@ -8341,9 +8257,9 @@ var dataStructureTyped = (() => {
8341
8257
  if (key === void 0) return [void 0, void 0];
8342
8258
  else if (key === null) return [null, void 0];
8343
8259
  const finalValue = value != null ? value : entryValue;
8344
- return [this._createNode(key, finalValue), finalValue];
8260
+ return [this.createNode(key, finalValue), finalValue];
8345
8261
  }
8346
- return [this._createNode(keyNodeOrEntry, value), value];
8262
+ return [this.createNode(keyNodeOrEntry, value), value];
8347
8263
  }
8348
8264
  /**
8349
8265
  * (Protected) Helper for cloning. Performs a BFS and adds all nodes to the new tree.
@@ -8428,7 +8344,7 @@ var dataStructureTyped = (() => {
8428
8344
  destNode = this.ensureNode(destNode);
8429
8345
  if (srcNode && destNode) {
8430
8346
  const { key, value } = destNode;
8431
- const tempNode = this._createNode(key, value);
8347
+ const tempNode = this.createNode(key, value);
8432
8348
  if (tempNode) {
8433
8349
  destNode.key = srcNode.key;
8434
8350
  if (!this._isMapMode) destNode.value = srcNode.value;
@@ -8690,7 +8606,7 @@ var dataStructureTyped = (() => {
8690
8606
  * @param [value] - The value for the new node (used if not in Map mode).
8691
8607
  * @returns The newly created BSTNode.
8692
8608
  */
8693
- _createNode(key, value) {
8609
+ createNode(key, value) {
8694
8610
  return new BSTNode(key, this._isMapMode ? void 0 : value);
8695
8611
  }
8696
8612
  /**
@@ -9160,7 +9076,7 @@ var dataStructureTyped = (() => {
9160
9076
  */
9161
9077
  _createInstance(options) {
9162
9078
  const Ctor = this.constructor;
9163
- return new Ctor([], __spreadValues(__spreadValues({}, this._snapshotOptions()), options != null ? options : {}));
9079
+ return new Ctor([], { ...this._snapshotOptions(), ...options != null ? options : {} });
9164
9080
  }
9165
9081
  /**
9166
9082
  * (Protected) Creates a new instance of the same BST constructor, potentially with different generic types.
@@ -9173,7 +9089,7 @@ var dataStructureTyped = (() => {
9173
9089
  */
9174
9090
  _createLike(iter = [], options) {
9175
9091
  const Ctor = this.constructor;
9176
- return new Ctor(iter, __spreadValues(__spreadValues({}, this._snapshotOptions()), options != null ? options : {}));
9092
+ return new Ctor(iter, { ...this._snapshotOptions(), ...options != null ? options : {} });
9177
9093
  }
9178
9094
  /**
9179
9095
  * (Protected) Snapshots the current BST's configuration options.
@@ -9183,10 +9099,11 @@ var dataStructureTyped = (() => {
9183
9099
  * @returns The options object.
9184
9100
  */
9185
9101
  _snapshotOptions() {
9186
- return __spreadProps(__spreadValues({}, super._snapshotOptions()), {
9102
+ return {
9103
+ ...super._snapshotOptions(),
9187
9104
  specifyComparable: this.specifyComparable,
9188
9105
  isReverse: this.isReverse
9189
- });
9106
+ };
9190
9107
  }
9191
9108
  /**
9192
9109
  * (Protected) Converts a key, node, or entry into a standardized [node, value] tuple.
@@ -9915,7 +9832,7 @@ var dataStructureTyped = (() => {
9915
9832
  * @param [value] - The value for the new node.
9916
9833
  * @returns The newly created AVLTreeNode.
9917
9834
  */
9918
- _createNode(key, value) {
9835
+ createNode(key, value) {
9919
9836
  return new AVLTreeNode(key, this._isMapMode ? void 0 : value);
9920
9837
  }
9921
9838
  /**
@@ -10018,7 +9935,7 @@ var dataStructureTyped = (() => {
10018
9935
  */
10019
9936
  _createInstance(options) {
10020
9937
  const Ctor = this.constructor;
10021
- return new Ctor([], __spreadValues(__spreadValues({}, this._snapshotOptions()), options != null ? options : {}));
9938
+ return new Ctor([], { ...this._snapshotOptions(), ...options != null ? options : {} });
10022
9939
  }
10023
9940
  /**
10024
9941
  * (Protected) Creates a new instance of the same AVLTree constructor, potentially with different generic types.
@@ -10031,7 +9948,7 @@ var dataStructureTyped = (() => {
10031
9948
  */
10032
9949
  _createLike(iter = [], options) {
10033
9950
  const Ctor = this.constructor;
10034
- return new Ctor(iter, __spreadValues(__spreadValues({}, this._snapshotOptions()), options != null ? options : {}));
9951
+ return new Ctor(iter, { ...this._snapshotOptions(), ...options != null ? options : {} });
10035
9952
  }
10036
9953
  /**
10037
9954
  * (Protected) Swaps properties of two nodes, including height.
@@ -10046,7 +9963,7 @@ var dataStructureTyped = (() => {
10046
9963
  const destNodeEnsured = this.ensureNode(destNode);
10047
9964
  if (srcNodeEnsured && destNodeEnsured) {
10048
9965
  const { key, value, height } = destNodeEnsured;
10049
- const tempNode = this._createNode(key, value);
9966
+ const tempNode = this.createNode(key, value);
10050
9967
  if (tempNode) {
10051
9968
  tempNode.height = height;
10052
9969
  destNodeEnsured.key = srcNodeEnsured.key;
@@ -10367,7 +10284,7 @@ var dataStructureTyped = (() => {
10367
10284
  * @param color - See parameter type for details.
10368
10285
  * @returns A new RedBlackTreeNode instance.
10369
10286
  */
10370
- _createNode(key, value, color = "BLACK") {
10287
+ createNode(key, value, color = "BLACK") {
10371
10288
  return new RedBlackTreeNode(key, this._isMapMode ? void 0 : value, color);
10372
10289
  }
10373
10290
  /**
@@ -10495,11 +10412,11 @@ var dataStructureTyped = (() => {
10495
10412
  }
10496
10413
  _createInstance(options) {
10497
10414
  const Ctor = this.constructor;
10498
- return new Ctor([], __spreadValues(__spreadValues({}, this._snapshotOptions()), options != null ? options : {}));
10415
+ return new Ctor([], { ...this._snapshotOptions(), ...options != null ? options : {} });
10499
10416
  }
10500
10417
  _createLike(iter = [], options) {
10501
10418
  const Ctor = this.constructor;
10502
- return new Ctor(iter, __spreadValues(__spreadValues({}, this._snapshotOptions()), options != null ? options : {}));
10419
+ return new Ctor(iter, { ...this._snapshotOptions(), ...options != null ? options : {} });
10503
10420
  }
10504
10421
  _setRoot(v) {
10505
10422
  if (v) {
@@ -10795,12 +10712,12 @@ var dataStructureTyped = (() => {
10795
10712
  * @returns New AVLTreeMultiMap instance.
10796
10713
  */
10797
10714
  constructor(keysNodesEntriesOrRaws = [], options) {
10798
- super([], __spreadProps(__spreadValues({}, options), { isMapMode: true }));
10715
+ super([], { ...options, isMapMode: true });
10799
10716
  if (keysNodesEntriesOrRaws) {
10800
10717
  this.addMany(keysNodesEntriesOrRaws);
10801
10718
  }
10802
10719
  }
10803
- _createNode(key, value = []) {
10720
+ createNode(key, value = []) {
10804
10721
  return new AVLTreeMultiMapNode(key, this._isMapMode ? [] : value);
10805
10722
  }
10806
10723
  /**
@@ -10926,7 +10843,7 @@ var dataStructureTyped = (() => {
10926
10843
  _createInstance(options) {
10927
10844
  var _a, _b;
10928
10845
  const Ctor = this.constructor;
10929
- return new Ctor([], __spreadValues(__spreadValues({}, (_b = (_a = this._snapshotOptions) == null ? void 0 : _a.call(this)) != null ? _b : {}), options != null ? options : {}));
10846
+ return new Ctor([], { ...(_b = (_a = this._snapshotOptions) == null ? void 0 : _a.call(this)) != null ? _b : {}, ...options != null ? options : {} });
10930
10847
  }
10931
10848
  /**
10932
10849
  * (Protected) Create a like-kind instance and seed it from an iterable.
@@ -10941,7 +10858,7 @@ var dataStructureTyped = (() => {
10941
10858
  _createLike(iter = [], options) {
10942
10859
  var _a, _b;
10943
10860
  const Ctor = this.constructor;
10944
- return new Ctor(iter, __spreadValues(__spreadValues({}, (_b = (_a = this._snapshotOptions) == null ? void 0 : _a.call(this)) != null ? _b : {}), options != null ? options : {}));
10861
+ return new Ctor(iter, { ...(_b = (_a = this._snapshotOptions) == null ? void 0 : _a.call(this)) != null ? _b : {}, ...options != null ? options : {} });
10945
10862
  }
10946
10863
  };
10947
10864
 
@@ -11010,12 +10927,12 @@ var dataStructureTyped = (() => {
11010
10927
  * @returns New TreeMultiMap instance.
11011
10928
  */
11012
10929
  constructor(keysNodesEntriesOrRaws = [], options) {
11013
- super([], __spreadValues({}, options));
10930
+ super([], { ...options });
11014
10931
  if (keysNodesEntriesOrRaws) {
11015
10932
  this.addMany(keysNodesEntriesOrRaws);
11016
10933
  }
11017
10934
  }
11018
- _createNode(key, value = []) {
10935
+ createNode(key, value = []) {
11019
10936
  return new TreeMultiMapNode(key, this._isMapMode ? [] : value);
11020
10937
  }
11021
10938
  /**
@@ -11113,7 +11030,7 @@ var dataStructureTyped = (() => {
11113
11030
  _createInstance(options) {
11114
11031
  var _a, _b;
11115
11032
  const Ctor = this.constructor;
11116
- return new Ctor([], __spreadValues(__spreadValues({}, (_b = (_a = this._snapshotOptions) == null ? void 0 : _a.call(this)) != null ? _b : {}), options != null ? options : {}));
11033
+ return new Ctor([], { ...(_b = (_a = this._snapshotOptions) == null ? void 0 : _a.call(this)) != null ? _b : {}, ...options != null ? options : {} });
11117
11034
  }
11118
11035
  /**
11119
11036
  * (Protected) Create a like-kind instance and seed it from an iterable.
@@ -11128,7 +11045,7 @@ var dataStructureTyped = (() => {
11128
11045
  _createLike(iter = [], options) {
11129
11046
  var _a, _b;
11130
11047
  const Ctor = this.constructor;
11131
- return new Ctor(iter, __spreadValues(__spreadValues({}, (_b = (_a = this._snapshotOptions) == null ? void 0 : _a.call(this)) != null ? _b : {}), options != null ? options : {}));
11048
+ return new Ctor(iter, { ...(_b = (_a = this._snapshotOptions) == null ? void 0 : _a.call(this)) != null ? _b : {}, ...options != null ? options : {} });
11132
11049
  }
11133
11050
  };
11134
11051
 
@@ -11222,7 +11139,7 @@ var dataStructureTyped = (() => {
11222
11139
  this.dfs((node) => sum += node ? node.count : 0);
11223
11140
  return sum;
11224
11141
  }
11225
- _createNode(key, value, color = "BLACK", count) {
11142
+ createNode(key, value, color = "BLACK", count) {
11226
11143
  return new TreeCounterNode(key, this._isMapMode ? void 0 : value, count, color);
11227
11144
  }
11228
11145
  /**
@@ -11423,7 +11340,7 @@ var dataStructureTyped = (() => {
11423
11340
  */
11424
11341
  _createInstance(options) {
11425
11342
  const Ctor = this.constructor;
11426
- return new Ctor([], __spreadValues(__spreadValues({}, this._snapshotOptions()), options != null ? options : {}));
11343
+ return new Ctor([], { ...this._snapshotOptions(), ...options != null ? options : {} });
11427
11344
  }
11428
11345
  /**
11429
11346
  * (Protected) Create a like-kind instance and seed it from an iterable.
@@ -11437,7 +11354,10 @@ var dataStructureTyped = (() => {
11437
11354
  */
11438
11355
  _createLike(iter = [], options) {
11439
11356
  const Ctor = this.constructor;
11440
- return new Ctor(iter, __spreadValues(__spreadValues({}, this._snapshotOptions()), options != null ? options : {}));
11357
+ return new Ctor(iter, {
11358
+ ...this._snapshotOptions(),
11359
+ ...options != null ? options : {}
11360
+ });
11441
11361
  }
11442
11362
  /**
11443
11363
  * (Protected) Normalize input into a node plus its effective value and count.
@@ -11454,9 +11374,9 @@ var dataStructureTyped = (() => {
11454
11374
  const [key, entryValue] = keyNodeOrEntry;
11455
11375
  if (key === void 0 || key === null) return [void 0, void 0];
11456
11376
  const finalValue = value != null ? value : entryValue;
11457
- return [this._createNode(key, finalValue, "BLACK", count), finalValue];
11377
+ return [this.createNode(key, finalValue, "BLACK", count), finalValue];
11458
11378
  }
11459
- return [this._createNode(keyNodeOrEntry, value, "BLACK", count), value];
11379
+ return [this.createNode(keyNodeOrEntry, value, "BLACK", count), value];
11460
11380
  }
11461
11381
  /**
11462
11382
  * (Protected) Swap keys/values/counters between the source and destination nodes.
@@ -11470,7 +11390,7 @@ var dataStructureTyped = (() => {
11470
11390
  destNode = this.ensureNode(destNode);
11471
11391
  if (srcNode && destNode) {
11472
11392
  const { key, value, count, color } = destNode;
11473
- const tempNode = this._createNode(key, value, color, count);
11393
+ const tempNode = this.createNode(key, value, color, count);
11474
11394
  if (tempNode) {
11475
11395
  tempNode.color = color;
11476
11396
  destNode.key = srcNode.key;
@@ -11583,7 +11503,7 @@ var dataStructureTyped = (() => {
11583
11503
  this.dfs((node) => sum += node.count);
11584
11504
  return sum;
11585
11505
  }
11586
- _createNode(key, value, count) {
11506
+ createNode(key, value, count) {
11587
11507
  return new AVLTreeCounterNode(key, this._isMapMode ? void 0 : value, count);
11588
11508
  }
11589
11509
  /**
@@ -11752,7 +11672,7 @@ var dataStructureTyped = (() => {
11752
11672
  */
11753
11673
  _createInstance(options) {
11754
11674
  const Ctor = this.constructor;
11755
- return new Ctor([], __spreadValues(__spreadValues({}, this._snapshotOptions()), options != null ? options : {}));
11675
+ return new Ctor([], { ...this._snapshotOptions(), ...options != null ? options : {} });
11756
11676
  }
11757
11677
  /**
11758
11678
  * (Protected) Create a like-kind instance and seed it from an iterable.
@@ -11766,7 +11686,7 @@ var dataStructureTyped = (() => {
11766
11686
  */
11767
11687
  _createLike(iter = [], options) {
11768
11688
  const Ctor = this.constructor;
11769
- return new Ctor(iter, __spreadValues(__spreadValues({}, this._snapshotOptions()), options != null ? options : {}));
11689
+ return new Ctor(iter, { ...this._snapshotOptions(), ...options != null ? options : {} });
11770
11690
  }
11771
11691
  /**
11772
11692
  * (Protected) Normalize input into a node plus its effective value and count.
@@ -11783,9 +11703,9 @@ var dataStructureTyped = (() => {
11783
11703
  const [key, entryValue] = keyNodeOrEntry;
11784
11704
  if (key === void 0 || key === null) return [void 0, void 0];
11785
11705
  const finalValue = value != null ? value : entryValue;
11786
- return [this._createNode(key, finalValue, count), finalValue];
11706
+ return [this.createNode(key, finalValue, count), finalValue];
11787
11707
  }
11788
- return [this._createNode(keyNodeOrEntry, value, count), value];
11708
+ return [this.createNode(keyNodeOrEntry, value, count), value];
11789
11709
  }
11790
11710
  /**
11791
11711
  * (Protected) Swap keys/values/counters between the source and destination nodes.
@@ -11799,7 +11719,7 @@ var dataStructureTyped = (() => {
11799
11719
  destNode = this.ensureNode(destNode);
11800
11720
  if (srcNode && destNode) {
11801
11721
  const { key, value, count, height } = destNode;
11802
- const tempNode = this._createNode(key, value, count);
11722
+ const tempNode = this.createNode(key, value, count);
11803
11723
  if (tempNode) {
11804
11724
  tempNode.height = height;
11805
11725
  destNode.key = srcNode.key;
@@ -11858,7 +11778,7 @@ var dataStructureTyped = (() => {
11858
11778
  * @remarks Complexity — Time: O(n log n) when inserting n elements incrementally; Space: O(n).
11859
11779
  */
11860
11780
  constructor(elements = [], options) {
11861
- super(elements, __spreadValues({
11781
+ super(elements, {
11862
11782
  comparator: (a, b) => {
11863
11783
  if (typeof a === "object" || typeof b === "object") {
11864
11784
  throw TypeError(
@@ -11868,8 +11788,9 @@ var dataStructureTyped = (() => {
11868
11788
  if (a < b) return 1;
11869
11789
  if (a > b) return -1;
11870
11790
  return 0;
11871
- }
11872
- }, options));
11791
+ },
11792
+ ...options
11793
+ });
11873
11794
  }
11874
11795
  };
11875
11796
 
@@ -12828,10 +12749,11 @@ var dataStructureTyped = (() => {
12828
12749
  */
12829
12750
  _createInstance(options) {
12830
12751
  const Ctor = this.constructor;
12831
- const next = new Ctor([], __spreadValues({
12752
+ const next = new Ctor([], {
12832
12753
  toElementFn: this.toElementFn,
12833
- caseSensitive: this.caseSensitive
12834
- }, options != null ? options : {}));
12754
+ caseSensitive: this.caseSensitive,
12755
+ ...options != null ? options : {}
12756
+ });
12835
12757
  return next;
12836
12758
  }
12837
12759
  /**
@@ -12867,10 +12789,10 @@ var dataStructureTyped = (() => {
12867
12789
  yield path;
12868
12790
  }
12869
12791
  for (const [char, childNode] of node.children) {
12870
- yield* __yieldStar(_dfs(childNode, path + char));
12792
+ yield* _dfs(childNode, path + char);
12871
12793
  }
12872
12794
  }
12873
- yield* __yieldStar(_dfs(this.root, ""));
12795
+ yield* _dfs(this.root, "");
12874
12796
  }
12875
12797
  /**
12876
12798
  * (Protected) Normalize a string according to case sensitivity.