tree-multimap-typed 2.4.3 → 2.4.4

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 (39) hide show
  1. package/dist/types/data-structures/base/iterable-element-base.d.ts +1 -1
  2. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +5 -5
  3. package/dist/types/data-structures/binary-tree/bst.d.ts +1 -1
  4. package/dist/types/data-structures/graph/directed-graph.d.ts +2 -2
  5. package/dist/types/data-structures/graph/undirected-graph.d.ts +2 -2
  6. package/dist/types/data-structures/hash/hash-map.d.ts +2 -2
  7. package/dist/types/data-structures/heap/heap.d.ts +3 -7
  8. package/dist/types/types/data-structures/binary-tree/avl-tree.d.ts +1 -1
  9. package/dist/types/types/data-structures/binary-tree/red-black-tree.d.ts +1 -1
  10. package/dist/types/types/data-structures/linked-list/doubly-linked-list.d.ts +1 -1
  11. package/dist/types/types/data-structures/linked-list/singly-linked-list.d.ts +1 -1
  12. package/dist/types/types/data-structures/priority-queue/priority-queue.d.ts +1 -1
  13. package/dist/types/types/data-structures/stack/stack.d.ts +1 -1
  14. package/dist/umd/tree-multimap-typed.js +28 -35
  15. package/dist/umd/tree-multimap-typed.js.map +1 -1
  16. package/dist/umd/tree-multimap-typed.min.js +2 -2
  17. package/dist/umd/tree-multimap-typed.min.js.map +1 -1
  18. package/package.json +2 -2
  19. package/src/data-structures/base/iterable-element-base.ts +2 -2
  20. package/src/data-structures/binary-tree/binary-tree.ts +8 -7
  21. package/src/data-structures/binary-tree/bst.ts +1 -1
  22. package/src/data-structures/binary-tree/tree-multi-set.ts +5 -5
  23. package/src/data-structures/graph/abstract-graph.ts +18 -18
  24. package/src/data-structures/graph/directed-graph.ts +4 -4
  25. package/src/data-structures/graph/map-graph.ts +1 -1
  26. package/src/data-structures/graph/undirected-graph.ts +4 -4
  27. package/src/data-structures/hash/hash-map.ts +6 -4
  28. package/src/data-structures/heap/heap.ts +17 -14
  29. package/src/data-structures/linked-list/doubly-linked-list.ts +4 -4
  30. package/src/data-structures/linked-list/singly-linked-list.ts +15 -9
  31. package/src/data-structures/queue/deque.ts +1 -1
  32. package/src/data-structures/stack/stack.ts +1 -1
  33. package/src/data-structures/trie/trie.ts +10 -5
  34. package/src/types/data-structures/binary-tree/avl-tree.ts +1 -1
  35. package/src/types/data-structures/binary-tree/red-black-tree.ts +1 -1
  36. package/src/types/data-structures/linked-list/doubly-linked-list.ts +1 -1
  37. package/src/types/data-structures/linked-list/singly-linked-list.ts +1 -1
  38. package/src/types/data-structures/priority-queue/priority-queue.ts +1 -1
  39. package/src/types/data-structures/stack/stack.ts +1 -1
@@ -27,7 +27,7 @@ export declare abstract class IterableElementBase<E, R> implements Iterable<E> {
27
27
  * @remarks
28
28
  * Time O(1), Space O(1).
29
29
  */
30
- protected _toElementFn?: (rawElement: R) => E;
30
+ protected readonly _toElementFn?: (rawElement: R) => E;
31
31
  /**
32
32
  * Exposes the current `toElementFn`, if configured.
33
33
  *
@@ -275,7 +275,7 @@ export declare class BinaryTree<K = any, V = any, R = any> extends IterableEntry
275
275
  * @param [options] - Configuration options for the tree.
276
276
  */
277
277
  constructor(keysNodesEntriesOrRaws?: Iterable<K | BinaryTreeNode<K, V> | [K | null | undefined, V | undefined] | null | undefined | R>, options?: BinaryTreeOptions<K, V, R>);
278
- protected _isMapMode: boolean;
278
+ protected readonly _isMapMode: boolean;
279
279
  /**
280
280
  * Gets whether the tree is in Map mode.
281
281
  * @remarks In Map mode (default), values are stored in an external Map, and nodes only hold keys. If false, values are stored directly on the nodes. Time O(1)
@@ -283,7 +283,7 @@ export declare class BinaryTree<K = any, V = any, R = any> extends IterableEntry
283
283
  * @returns True if in Map mode, false otherwise.
284
284
  */
285
285
  get isMapMode(): boolean;
286
- protected _isDuplicate: boolean;
286
+ protected readonly _isDuplicate: boolean;
287
287
  /**
288
288
  * Gets whether the tree allows duplicate keys.
289
289
  * @remarks Time O(1)
@@ -315,7 +315,7 @@ export declare class BinaryTree<K = any, V = any, R = any> extends IterableEntry
315
315
  * @returns The size of the tree.
316
316
  */
317
317
  get size(): number;
318
- protected _NIL: BinaryTreeNode<K, V>;
318
+ protected readonly _NIL: BinaryTreeNode<K, V>;
319
319
  /**
320
320
  * Gets the sentinel NIL node (used in self-balancing trees like Red-Black Tree).
321
321
  * @remarks Time O(1)
@@ -323,7 +323,7 @@ export declare class BinaryTree<K = any, V = any, R = any> extends IterableEntry
323
323
  * @returns The NIL node.
324
324
  */
325
325
  get NIL(): BinaryTreeNode<K, V>;
326
- protected _toEntryFn?: ToEntryFn<K, V, R>;
326
+ protected readonly _toEntryFn?: ToEntryFn<K, V, R>;
327
327
  /**
328
328
  * Gets the function used to convert raw data objects (R) into [key, value] entries.
329
329
  * @remarks Time O(1)
@@ -682,7 +682,7 @@ export declare class BinaryTree<K = any, V = any, R = any> extends IterableEntry
682
682
  * @param node - The node.
683
683
  * @returns The node's key or undefined.
684
684
  */
685
- protected _DEFAULT_NODE_CALLBACK: (node: BinaryTreeNode<K, V> | null | undefined) => K | undefined;
685
+ protected readonly _DEFAULT_NODE_CALLBACK: NodeCallback<BinaryTreeNode<K, V> | null | undefined, K | undefined>;
686
686
  /**
687
687
  * (Protected) Snapshots the current tree's configuration options.
688
688
  * @remarks Time O(1)
@@ -294,7 +294,7 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
294
294
 
295
295
  * @remarks Time O(1) Space O(1)
296
296
  */
297
- protected _comparator: Comparator<K>;
297
+ protected readonly _comparator: Comparator<K>;
298
298
  /**
299
299
  * Gets the comparator function used by the tree.
300
300
  * @remarks Time O(1)
@@ -170,7 +170,7 @@ export declare class DirectedGraph<V = any, E = any, VO extends DirectedVertex<V
170
170
  * @returns DirectedGraph with all keys added.
171
171
  * @remarks Time O(V), Space O(V)
172
172
  */
173
- static fromKeys<K extends VertexKey>(keys: Iterable<K>): DirectedGraph<K, any, DirectedVertex<K>, DirectedEdge<any>>;
173
+ static fromKeys<K extends VertexKey>(keys: Iterable<K>): DirectedGraph<K, undefined, DirectedVertex<K>, DirectedEdge<undefined>>;
174
174
  /**
175
175
  * Construct a directed graph from `[key, value]` entries.
176
176
  * @template V - Vertex value type.
@@ -178,7 +178,7 @@ export declare class DirectedGraph<V = any, E = any, VO extends DirectedVertex<V
178
178
  * @returns DirectedGraph with all vertices added.
179
179
  * @remarks Time O(V), Space O(V)
180
180
  */
181
- static fromEntries<V>(entries: Iterable<[VertexKey, V]>): DirectedGraph<V, any, DirectedVertex<V>, DirectedEdge<any>>;
181
+ static fromEntries<V>(entries: Iterable<[VertexKey, V]>): DirectedGraph<V, undefined, DirectedVertex<V>, DirectedEdge<undefined>>;
182
182
  /**
183
183
  * Create a directed vertex instance. Does not insert into the graph.
184
184
  * @param key - Vertex identifier.
@@ -200,7 +200,7 @@ export declare class UndirectedGraph<V = any, E = any, VO extends UndirectedVert
200
200
  * @returns UndirectedGraph with all keys added.
201
201
  * @remarks Time O(V), Space O(V)
202
202
  */
203
- static fromKeys<K extends VertexKey>(keys: Iterable<K>): UndirectedGraph<K, any, UndirectedVertex<K>, UndirectedEdge<any>>;
203
+ static fromKeys<K extends VertexKey>(keys: Iterable<K>): UndirectedGraph<K, undefined, UndirectedVertex<K>, UndirectedEdge<undefined>>;
204
204
  /**
205
205
  * Construct an undirected graph from `[key, value]` entries.
206
206
  * @template V - Vertex value type.
@@ -208,7 +208,7 @@ export declare class UndirectedGraph<V = any, E = any, VO extends UndirectedVert
208
208
  * @returns UndirectedGraph with all vertices added.
209
209
  * @remarks Time O(V), Space O(V)
210
210
  */
211
- static fromEntries<V>(entries: Iterable<[VertexKey, V]>): UndirectedGraph<V, any, UndirectedVertex<V>, UndirectedEdge<any>>;
211
+ static fromEntries<V>(entries: Iterable<[VertexKey, V]>): UndirectedGraph<V, undefined, UndirectedVertex<V>, UndirectedEdge<undefined>>;
212
212
  /**
213
213
  * Create an undirected vertex instance. Does not insert into the graph.
214
214
  * @param key - Vertex identifier.
@@ -175,7 +175,7 @@ export declare class HashMap<K = any, V = any, R = [K, V]> extends IterableEntry
175
175
  * @returns Map of object→value.
176
176
  */
177
177
  get objMap(): Map<object, V>;
178
- protected _toEntryFn?: (rawElement: R) => [K, V];
178
+ protected readonly _toEntryFn?: (rawElement: R) => [K, V];
179
179
  /**
180
180
  * Get the raw→entry converter function if present.
181
181
  * @remarks Time O(1), Space O(1)
@@ -346,7 +346,7 @@ export declare class LinkedHashMap<K = any, V = any, R = [K, V]> extends Iterabl
346
346
  * @returns Tail node or sentinel.
347
347
  */
348
348
  get tail(): HashMapLinkedNode<K, V | undefined>;
349
- protected _toEntryFn?: (rawElement: R) => [K, V];
349
+ protected readonly _toEntryFn?: (rawElement: R) => [K, V];
350
350
  get toEntryFn(): ((rawElement: R) => [K, V]) | undefined;
351
351
  protected _size: number;
352
352
  get size(): number;
@@ -414,12 +414,8 @@ export declare class Heap<E = any, R = any> extends IterableElementBase<E, R> {
414
414
  * @returns A new heap with mapped elements.
415
415
  */
416
416
  mapSame(callback: ElementCallback<E, R, E>, thisArg?: unknown): this;
417
- protected _DEFAULT_COMPARATOR: (a: E, b: E) => number;
418
- protected _comparator: Comparator<E>; /**
419
- * Get the comparator used to order elements.
420
- * @remarks Time O(1), Space O(1)
421
- * @returns Comparator function.
422
- */
417
+ protected readonly _DEFAULT_COMPARATOR: Comparator<E>;
418
+ protected readonly _comparator: Comparator<E>;
423
419
  /**
424
420
  * Get the comparator used to order elements.
425
421
  * @remarks Time O(1), Space O(1)
@@ -501,7 +497,7 @@ export declare class FibonacciHeap<E> {
501
497
  * @returns Min node or undefined.
502
498
  */
503
499
  get min(): FibonacciHeapNode<E> | undefined;
504
- protected _comparator: Comparator<E>;
500
+ protected readonly _comparator: Comparator<E>;
505
501
  get comparator(): Comparator<E>;
506
502
  clear(): void;
507
503
  add(element: E): boolean;
@@ -1,2 +1,2 @@
1
1
  import { BSTOptions } from './bst';
2
- export type AVLTreeOptions<K, V, R> = BSTOptions<K, V, R> & {};
2
+ export type AVLTreeOptions<K, V, R> = BSTOptions<K, V, R>;
@@ -1,3 +1,3 @@
1
1
  import type { BSTOptions } from './bst';
2
2
  export type RBTNColor = 'RED' | 'BLACK';
3
- export type RedBlackTreeOptions<K, V, R> = BSTOptions<K, V, R> & {};
3
+ export type RedBlackTreeOptions<K, V, R> = BSTOptions<K, V, R>;
@@ -1,2 +1,2 @@
1
1
  import { LinearBaseOptions } from '../base';
2
- export type DoublyLinkedListOptions<E, R> = LinearBaseOptions<E, R> & {};
2
+ export type DoublyLinkedListOptions<E, R> = LinearBaseOptions<E, R>;
@@ -1,2 +1,2 @@
1
1
  import { LinearBaseOptions } from '../base';
2
- export type SinglyLinkedListOptions<E, R> = LinearBaseOptions<E, R> & {};
2
+ export type SinglyLinkedListOptions<E, R> = LinearBaseOptions<E, R>;
@@ -1,2 +1,2 @@
1
1
  import { HeapOptions } from '../heap';
2
- export type PriorityQueueOptions<E, R> = HeapOptions<E, R> & {};
2
+ export type PriorityQueueOptions<E, R> = HeapOptions<E, R>;
@@ -1,2 +1,2 @@
1
1
  import { IterableElementBaseOptions } from '../base';
2
- export type StackOptions<E, R> = IterableElementBaseOptions<E, R> & {};
2
+ export type StackOptions<E, R> = IterableElementBaseOptions<E, R>;
@@ -1026,8 +1026,9 @@ var treeMultimapTyped = (() => {
1026
1026
  const cur = node;
1027
1027
  node = node.next;
1028
1028
  if (predicate(cur.key, cur.value, i++, this)) {
1029
- if (isWeakKey(cur.key)) {
1030
- this._objMap.delete(cur.key);
1029
+ const keyToCheck = cur.key;
1030
+ if (isWeakKey(keyToCheck)) {
1031
+ this._objMap.delete(keyToCheck);
1031
1032
  } else {
1032
1033
  const hash = this._hashFn(cur.key);
1033
1034
  delete this._noObjMap[hash];
@@ -1540,7 +1541,7 @@ var treeMultimapTyped = (() => {
1540
1541
  */
1541
1542
  constructor(elements = [], options) {
1542
1543
  super(options);
1543
- __publicField(this, "_equals", Object.is);
1544
+ __publicField(this, "_equals", /* @__PURE__ */ __name((a, b) => Object.is(a, b), "_equals"));
1544
1545
  __publicField(this, "_head");
1545
1546
  __publicField(this, "_tail");
1546
1547
  __publicField(this, "_length", 0);
@@ -1628,6 +1629,7 @@ var treeMultimapTyped = (() => {
1628
1629
  * @returns Removed element or undefined.
1629
1630
  */
1630
1631
  pop() {
1632
+ var _a;
1631
1633
  if (!this.head) return void 0;
1632
1634
  if (this.head === this.tail) {
1633
1635
  const value2 = this.head.value;
@@ -1637,8 +1639,8 @@ var treeMultimapTyped = (() => {
1637
1639
  return value2;
1638
1640
  }
1639
1641
  let current = this.head;
1640
- while (current.next !== this.tail) current = current.next;
1641
- const value = this.tail.value;
1642
+ while (current.next && current.next !== this.tail) current = current.next;
1643
+ const value = (_a = this.tail) == null ? void 0 : _a.value;
1642
1644
  current.next = void 0;
1643
1645
  this._tail = current;
1644
1646
  this._length--;
@@ -1726,8 +1728,8 @@ var treeMultimapTyped = (() => {
1726
1728
  at(index) {
1727
1729
  if (index < 0 || index >= this._length) return void 0;
1728
1730
  let current = this.head;
1729
- for (let i = 0; i < index; i++) current = current.next;
1730
- return current.value;
1731
+ for (let i = 0; i < index && current; i++) current = current.next;
1732
+ return current == null ? void 0 : current.value;
1731
1733
  }
1732
1734
  /**
1733
1735
  * Type guard: check whether the input is a SinglyLinkedListNode.
@@ -1747,7 +1749,7 @@ var treeMultimapTyped = (() => {
1747
1749
  getNodeAt(index) {
1748
1750
  if (index < 0 || index >= this._length) return void 0;
1749
1751
  let current = this.head;
1750
- for (let i = 0; i < index; i++) current = current.next;
1752
+ for (let i = 0; i < index && current; i++) current = current.next;
1751
1753
  return current;
1752
1754
  }
1753
1755
  /**
@@ -2261,7 +2263,7 @@ var treeMultimapTyped = (() => {
2261
2263
  */
2262
2264
  constructor(elements = [], options) {
2263
2265
  super(options);
2264
- __publicField(this, "_equals", Object.is);
2266
+ __publicField(this, "_equals", /* @__PURE__ */ __name((a, b) => Object.is(a, b), "_equals"));
2265
2267
  __publicField(this, "_head");
2266
2268
  __publicField(this, "_tail");
2267
2269
  __publicField(this, "_length", 0);
@@ -2449,8 +2451,8 @@ var treeMultimapTyped = (() => {
2449
2451
  at(index) {
2450
2452
  if (index < 0 || index >= this._length) return void 0;
2451
2453
  let current = this.head;
2452
- for (let i = 0; i < index; i++) current = current.next;
2453
- return current.value;
2454
+ for (let i = 0; i < index && current; i++) current = current.next;
2455
+ return current == null ? void 0 : current.value;
2454
2456
  }
2455
2457
  /**
2456
2458
  * Get the node reference at a given index.
@@ -2461,7 +2463,7 @@ var treeMultimapTyped = (() => {
2461
2463
  getNodeAt(index) {
2462
2464
  if (index < 0 || index >= this._length) return void 0;
2463
2465
  let current = this.head;
2464
- for (let i = 0; i < index; i++) current = current.next;
2466
+ for (let i = 0; i < index && current; i++) current = current.next;
2465
2467
  return current;
2466
2468
  }
2467
2469
  /**
@@ -2967,7 +2969,7 @@ var treeMultimapTyped = (() => {
2967
2969
  */
2968
2970
  constructor(elements = [], options) {
2969
2971
  super(options);
2970
- __publicField(this, "_equals", Object.is);
2972
+ __publicField(this, "_equals", /* @__PURE__ */ __name((a, b) => Object.is(a, b), "_equals"));
2971
2973
  __publicField(this, "_elements", []);
2972
2974
  this.pushMany(elements);
2973
2975
  }
@@ -3596,7 +3598,7 @@ var treeMultimapTyped = (() => {
3596
3598
  */
3597
3599
  constructor(elements = [], options) {
3598
3600
  super(options);
3599
- __publicField(this, "_equals", Object.is);
3601
+ __publicField(this, "_equals", /* @__PURE__ */ __name((a, b) => Object.is(a, b), "_equals"));
3600
3602
  __publicField(this, "_bucketSize", 1 << 12);
3601
3603
  __publicField(this, "_bucketFirst", 0);
3602
3604
  __publicField(this, "_firstInBucket", 0);
@@ -4665,11 +4667,6 @@ var treeMultimapTyped = (() => {
4665
4667
  }
4666
4668
  return out;
4667
4669
  }
4668
- /**
4669
- * Get the comparator used to order elements.
4670
- * @remarks Time O(1), Space O(1)
4671
- * @returns Comparator function.
4672
- */
4673
4670
  /**
4674
4671
  * Get the comparator used to order elements.
4675
4672
  * @remarks Time O(1), Space O(1)
@@ -4718,8 +4715,7 @@ var treeMultimapTyped = (() => {
4718
4715
  */
4719
4716
  _createInstance(options) {
4720
4717
  const Ctor = this.constructor;
4721
- const next = new Ctor([], { comparator: this.comparator, toElementFn: this.toElementFn, ...options != null ? options : {} });
4722
- return next;
4718
+ return new Ctor([], { comparator: this.comparator, toElementFn: this.toElementFn, ...options != null ? options : {} });
4723
4719
  }
4724
4720
  /**
4725
4721
  * (Protected) Create a like-kind instance seeded by elements.
@@ -5756,8 +5752,8 @@ var treeMultimapTyped = (() => {
5756
5752
  const Ctor = this.constructor;
5757
5753
  const instance = new Ctor();
5758
5754
  const graph = _options == null ? void 0 : _options.graph;
5759
- if (graph) instance._options = { ...instance._options, ...graph };
5760
- else instance._options = { ...instance._options, ...this._options };
5755
+ if (graph) instance["_options"] = { ...instance["_options"], ...graph };
5756
+ else instance["_options"] = { ...instance["_options"], ...this._options };
5761
5757
  return instance;
5762
5758
  }
5763
5759
  /**
@@ -5790,12 +5786,10 @@ var treeMultimapTyped = (() => {
5790
5786
  const [va, vb] = ends;
5791
5787
  const ka = va.key;
5792
5788
  const kb = vb.key;
5793
- const hasA = g.hasVertex ? g.hasVertex(ka) : false;
5794
- const hasB = g.hasVertex ? g.hasVertex(kb) : false;
5789
+ const hasA = typeof g.hasVertex === "function" ? g.hasVertex(ka) : false;
5790
+ const hasB = typeof g.hasVertex === "function" ? g.hasVertex(kb) : false;
5795
5791
  if (hasA && hasB) {
5796
- const w = e.weight;
5797
- const val = e.value;
5798
- const newEdge = g.createEdge(ka, kb, w, val);
5792
+ const newEdge = g.createEdge(ka, kb, e.weight, e.value);
5799
5793
  g._addEdge(newEdge);
5800
5794
  }
5801
5795
  }
@@ -6960,7 +6954,7 @@ var treeMultimapTyped = (() => {
6960
6954
  __publicField(this, "_size", 0);
6961
6955
  __publicField(this, "_NIL", new BinaryTreeNode(NaN));
6962
6956
  __publicField(this, "_toEntryFn");
6963
- __publicField(this, "_DEFAULT_NODE_CALLBACK", /* @__PURE__ */ __name((node) => node ? node.key : void 0, "_DEFAULT_NODE_CALLBACK"));
6957
+ __publicField(this, "_DEFAULT_NODE_CALLBACK", /* @__PURE__ */ __name((node) => node == null ? void 0 : node.key, "_DEFAULT_NODE_CALLBACK"));
6964
6958
  if (options) {
6965
6959
  const { iterationType, toEntryFn, isMapMode, isDuplicate } = options;
6966
6960
  if (iterationType) this.iterationType = iterationType;
@@ -13143,7 +13137,7 @@ var treeMultimapTyped = (() => {
13143
13137
  * @remarks Time O(1), Space O(1)
13144
13138
  */
13145
13139
  get comparator() {
13146
- return __privateGet(this, _core4)._comparator;
13140
+ return __privateGet(this, _core4).comparator;
13147
13141
  }
13148
13142
  // ━━━ clear ━━━
13149
13143
  /**
@@ -13280,7 +13274,7 @@ var treeMultimapTyped = (() => {
13280
13274
  filter(predicate) {
13281
13275
  const result = new _TreeMultiSet2([], {
13282
13276
  comparator: __privateGet(this, _isDefaultComparator4) ? void 0 : this.comparator,
13283
- isMapMode: __privateGet(this, _core4)._isMapMode
13277
+ isMapMode: __privateGet(this, _core4).isMapMode
13284
13278
  });
13285
13279
  for (const [k, c] of this.entries()) {
13286
13280
  if (predicate(k, c)) {
@@ -13320,7 +13314,7 @@ var treeMultimapTyped = (() => {
13320
13314
  map(mapper, options) {
13321
13315
  const result = new _TreeMultiSet2([], {
13322
13316
  comparator: options == null ? void 0 : options.comparator,
13323
- isMapMode: __privateGet(this, _core4)._isMapMode
13317
+ isMapMode: __privateGet(this, _core4).isMapMode
13324
13318
  });
13325
13319
  for (const [k, c] of this.entries()) {
13326
13320
  const [newKey, newCount] = mapper(k, c);
@@ -13340,7 +13334,7 @@ var treeMultimapTyped = (() => {
13340
13334
  clone() {
13341
13335
  const result = new _TreeMultiSet2([], {
13342
13336
  comparator: __privateGet(this, _isDefaultComparator4) ? void 0 : this.comparator,
13343
- isMapMode: __privateGet(this, _core4)._isMapMode
13337
+ isMapMode: __privateGet(this, _core4).isMapMode
13344
13338
  });
13345
13339
  for (const [k, c] of this.entries()) {
13346
13340
  result.add(k, c);
@@ -14371,12 +14365,11 @@ var treeMultimapTyped = (() => {
14371
14365
  */
14372
14366
  _createInstance(options) {
14373
14367
  const Ctor = this.constructor;
14374
- const next = new Ctor([], {
14368
+ return new Ctor([], {
14375
14369
  toElementFn: this.toElementFn,
14376
14370
  caseSensitive: this.caseSensitive,
14377
14371
  ...options != null ? options : {}
14378
14372
  });
14379
- return next;
14380
14373
  }
14381
14374
  /**
14382
14375
  * (Protected) Create a like-kind trie and seed it from an iterable.