tree-multimap-typed 2.4.2 → 2.4.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.
@@ -185,4 +185,14 @@ export declare class TreeMap<K = any, V = any, R = [K, V]> implements Iterable<[
185
185
  * @param options Inclusive/exclusive bounds (defaults to inclusive).
186
186
  */
187
187
  rangeSearch(range: [K, K], options?: TreeMapRangeOptions): Array<[K, V | undefined]>;
188
+ /**
189
+ * Creates a shallow clone of this map.
190
+ * @remarks Time O(n log n), Space O(n)
191
+ * @example
192
+ * const original = new TreeMap([['a', 1], ['b', 2]]);
193
+ * const copy = original.clone();
194
+ * copy.set('c', 3);
195
+ * original.has('c'); // false (original unchanged)
196
+ */
197
+ clone(): TreeMap<K, V>;
188
198
  }
@@ -178,4 +178,14 @@ export declare class TreeSet<K = any, R = K> implements Iterable<K> {
178
178
  * @param options Inclusive/exclusive bounds (defaults to inclusive).
179
179
  */
180
180
  rangeSearch(range: [K, K], options?: TreeSetRangeOptions): K[];
181
+ /**
182
+ * Creates a shallow clone of this set.
183
+ * @remarks Time O(n log n), Space O(n)
184
+ * @example
185
+ * const original = new TreeSet([1, 2, 3]);
186
+ * const copy = original.clone();
187
+ * copy.add(4);
188
+ * original.has(4); // false (original unchanged)
189
+ */
190
+ clone(): TreeSet<K>;
181
191
  }
@@ -12077,6 +12077,21 @@ var treeMultimapTyped = (() => {
12077
12077
  }
12078
12078
  return out;
12079
12079
  }
12080
+ /**
12081
+ * Creates a shallow clone of this set.
12082
+ * @remarks Time O(n log n), Space O(n)
12083
+ * @example
12084
+ * const original = new TreeSet([1, 2, 3]);
12085
+ * const copy = original.clone();
12086
+ * copy.add(4);
12087
+ * original.has(4); // false (original unchanged)
12088
+ */
12089
+ clone() {
12090
+ return new _TreeSet2(this, {
12091
+ comparator: __privateGet(this, _isDefaultComparator) ? void 0 : __privateGet(this, _userComparator),
12092
+ isMapMode: __privateGet(this, _core).isMapMode
12093
+ });
12094
+ }
12080
12095
  };
12081
12096
  _core = /* @__PURE__ */ new WeakMap();
12082
12097
  _isDefaultComparator = /* @__PURE__ */ new WeakMap();
@@ -12896,6 +12911,21 @@ var treeMultimapTyped = (() => {
12896
12911
  }
12897
12912
  return out;
12898
12913
  }
12914
+ /**
12915
+ * Creates a shallow clone of this map.
12916
+ * @remarks Time O(n log n), Space O(n)
12917
+ * @example
12918
+ * const original = new TreeMap([['a', 1], ['b', 2]]);
12919
+ * const copy = original.clone();
12920
+ * copy.set('c', 3);
12921
+ * original.has('c'); // false (original unchanged)
12922
+ */
12923
+ clone() {
12924
+ return new _TreeMap2(this, {
12925
+ comparator: __privateGet(this, _isDefaultComparator3) ? void 0 : __privateGet(this, _userComparator2),
12926
+ isMapMode: __privateGet(this, _core3).isMapMode
12927
+ });
12928
+ }
12899
12929
  };
12900
12930
  _core3 = /* @__PURE__ */ new WeakMap();
12901
12931
  _isDefaultComparator3 = /* @__PURE__ */ new WeakMap();