@tspro/ts-utils-lib 1.19.0 → 1.19.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.19.1] - 2025-10-27
4
+ ## Fixed
5
+ - Forgot to export `DefaultArray`, `SetBase`, `Set1` and `DeepSet`.
6
+
3
7
  ## [1.19.0] - 2025-10-27
4
8
  ### Added
5
9
  - SignedIndexArray.toArray(), IndexArray.toArray(), IndexArray.length;
package/dist/index.d.mts CHANGED
@@ -1057,6 +1057,59 @@ declare class SignedIndexArray<VALUE> implements KVComponent<[number], VALUE> {
1057
1057
  toString(): string;
1058
1058
  }
1059
1059
 
1060
+ /**
1061
+ * `DefaultArray` is an array list where every index is guaranteed to have a value.
1062
+ * There are no undefineds unless that is part of the value type.
1063
+ * When you create `DefaultArray` you give a default value. For example if you
1064
+ * delete an index then that index is set to the default value.
1065
+ */
1066
+ declare class DefaultArray<VALUE> implements KVComponent<[number], VALUE> {
1067
+ readonly defaultValue: VALUE;
1068
+ private data;
1069
+ constructor(values: Iterable<VALUE>, defaultValue: VALUE);
1070
+ constructor(length: number, defaultValue: VALUE);
1071
+ get size(): number;
1072
+ get length(): number;
1073
+ private assertId;
1074
+ isEmpty(): boolean;
1075
+ isDefault(id: number): boolean;
1076
+ isSet(id: number): boolean;
1077
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
1078
+ has(id: number): boolean;
1079
+ set(id: number, value: VALUE): VALUE;
1080
+ get(id: number): VALUE;
1081
+ getOrDefault(id: number, defaultValue: VALUE): VALUE;
1082
+ getOrCreate(id: number, value: VALUE): VALUE;
1083
+ getOrCreate(id: number, creator: () => VALUE): VALUE;
1084
+ delete(id: number): boolean;
1085
+ clear(empty?: boolean): void;
1086
+ forEach(callbackfn: (value: VALUE, id: number, arr: DefaultArray<VALUE>) => void, thisArg?: any): void;
1087
+ indices(): IterableIterator<number>;
1088
+ values(): IterableIterator<VALUE>;
1089
+ entries(): IterableIterator<[number, VALUE]>;
1090
+ indicesArray(): number[];
1091
+ valuesArray(): VALUE[];
1092
+ entriesArray(): [number, VALUE][];
1093
+ kvKeys(): IterableIterator<[number]>;
1094
+ kvValues(): IterableIterator<VALUE>;
1095
+ kvEntries(): IterableIterator<[[number], VALUE]>;
1096
+ [Symbol.iterator](): IterableIterator<[number, VALUE]>;
1097
+ clone(): this;
1098
+ merge(other: DefaultArray<VALUE>, conflictResolver?: (oldValue: VALUE, newValue: VALUE, id: number) => VALUE): this;
1099
+ some(fn: (value: VALUE, id: number) => boolean): boolean;
1100
+ every(fn: (value: VALUE, key1: number) => boolean): boolean;
1101
+ filter<S extends VALUE>(predicate: (value: VALUE, id: number, array: DefaultArray<VALUE>) => value is S): DefaultArray<S>;
1102
+ filter(predicate: (value: VALUE, id: number, array: DefaultArray<VALUE>) => unknown): DefaultArray<VALUE>;
1103
+ reduce(fn: (acc: VALUE, value: VALUE, id: number) => VALUE): VALUE;
1104
+ reduce<R>(fn: (acc: R, value: VALUE, id: number) => R, init: R): R;
1105
+ mapToArray<R>(fn: (value: VALUE, key1: number) => R): R[];
1106
+ map<R = VALUE>(fn: (value: VALUE, key1: number) => R, defaultValue: R): DefaultArray<R>;
1107
+ equals(other: DefaultArray<VALUE>): boolean;
1108
+ equals(other: DefaultArray<VALUE>, eq: (a: VALUE, b: VALUE) => boolean): boolean;
1109
+ toArray(): VALUE[];
1110
+ toString(): string;
1111
+ }
1112
+
1060
1113
  /**
1061
1114
  * A Map implementation mapping a single key to a value.
1062
1115
  */
@@ -1189,6 +1242,79 @@ declare class Map3<KEY1, KEY2, KEY3, VALUE> implements KVComponent<[KEY1, KEY2,
1189
1242
  toString(): string;
1190
1243
  }
1191
1244
 
1245
+ /**
1246
+ * An abstract base class implementation of a Set data structure.
1247
+ */
1248
+ declare abstract class SetBase<VALUE, CLS extends SetBase<VALUE, CLS> = any> implements KVComponent<[VALUE], VALUE> {
1249
+ protected data: Set<VALUE>;
1250
+ constructor(entries?: Iterable<VALUE>);
1251
+ protected abstract valueEquals(a: VALUE, b: VALUE): boolean;
1252
+ protected abstract createEmpty<R = VALUE>(): SetBase<R, any>;
1253
+ protected abstract getName(): string;
1254
+ has(value: VALUE): boolean;
1255
+ add(value: VALUE): VALUE;
1256
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
1257
+ set(key: VALUE, value: VALUE): void;
1258
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
1259
+ get(key: VALUE): VALUE | undefined;
1260
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
1261
+ getOrDefault(key: VALUE, defaultValue: VALUE): VALUE;
1262
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
1263
+ getOrCreate(key: VALUE, value: VALUE): VALUE;
1264
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
1265
+ getOrCreate(key: VALUE, creator: () => VALUE): VALUE;
1266
+ delete(value: VALUE): boolean;
1267
+ clear(): void;
1268
+ get size(): number;
1269
+ isEmpty(): boolean;
1270
+ forEach(callbackfn: (value: VALUE, set1: SetBase<VALUE>) => void, thisArg?: any): void;
1271
+ keys(): IterableIterator<VALUE>;
1272
+ values(): IterableIterator<VALUE>;
1273
+ entries(): IterableIterator<[VALUE, VALUE]>;
1274
+ kvKeys(): IterableIterator<[VALUE]>;
1275
+ kvValues(): IterableIterator<VALUE>;
1276
+ kvEntries(): IterableIterator<[[VALUE], VALUE]>;
1277
+ [Symbol.iterator](): IterableIterator<VALUE>;
1278
+ clone(): SetBase<VALUE>;
1279
+ merge(other: SetBase<VALUE>): this;
1280
+ some(fn: (value: VALUE) => boolean): boolean;
1281
+ every(fn: (value: VALUE) => boolean): boolean;
1282
+ filter<R extends VALUE>(predicate: (value: VALUE, set1: SetBase<VALUE, any>) => value is R): SetBase<R, any>;
1283
+ filter(predicate: (value: VALUE, set1: SetBase<VALUE>) => unknown): SetBase<VALUE, any>;
1284
+ reduce(fn: (acc: VALUE, value: VALUE) => VALUE): VALUE;
1285
+ reduce<R = VALUE>(fn: (acc: R, value: VALUE) => R, init: R): R;
1286
+ mapValues<R = VALUE>(fn: (value: VALUE) => R): SetBase<R, any>;
1287
+ mapToArray<R = VALUE>(fn: (value: VALUE) => R): R[];
1288
+ map<R = VALUE>(fn: (value: VALUE) => R): SetBase<R, any>;
1289
+ toSet(): Set<VALUE>;
1290
+ toArray(): VALUE[];
1291
+ toString(): string;
1292
+ }
1293
+ /**
1294
+ * A simple Set data structure. Comparison of values is done
1295
+ * using === operator (e.g. "a" === "a", but [1, 2] !== [1, 2]).
1296
+ */
1297
+ declare class Set1<VALUE> extends SetBase<VALUE, Set1<VALUE>> {
1298
+ constructor();
1299
+ constructor(set: SetBase<VALUE>);
1300
+ constructor(entries: Iterable<VALUE>);
1301
+ protected createEmpty<R = VALUE>(): Set1<R>;
1302
+ protected valueEquals(a: VALUE, b: VALUE): boolean;
1303
+ protected getName(): string;
1304
+ }
1305
+ /**
1306
+ * A simple Set data structure, where comparison of values is done
1307
+ * using deep equality (e.g. "a" === "a" and also [1, 2] === [1, 2]).
1308
+ */
1309
+ declare class DeepSet<VALUE> extends SetBase<VALUE, DeepSet<VALUE>> {
1310
+ constructor();
1311
+ constructor(set: SetBase<VALUE>);
1312
+ constructor(entries: Iterable<VALUE>);
1313
+ protected createEmpty<R = VALUE>(): DeepSet<R>;
1314
+ protected valueEquals(a: VALUE, b: VALUE): boolean;
1315
+ protected getName(): string;
1316
+ }
1317
+
1192
1318
  /**
1193
1319
  * Wrapper class of a key-value container that contain array values.
1194
1320
  */
@@ -1270,4 +1396,4 @@ declare class SmallIntCache<VALUE> {
1270
1396
  clear(): void;
1271
1397
  }
1272
1398
 
1273
- export { index$7 as Assert, cookies as Cookies, device as Device, DivRect, Guard, IndexArray, type KVComponent, LRUCache, Map1, Map2, Map3, MultiContainer, SignedIndexArray, SmallIntCache, Stack, index as Utils, Vec, Vec2, asMulti };
1399
+ export { index$7 as Assert, cookies as Cookies, DeepSet, DefaultArray, device as Device, DivRect, Guard, IndexArray, type KVComponent, LRUCache, Map1, Map2, Map3, MultiContainer, Set1, SetBase, SignedIndexArray, SmallIntCache, Stack, index as Utils, Vec, Vec2, asMulti };
package/dist/index.d.ts CHANGED
@@ -1057,6 +1057,59 @@ declare class SignedIndexArray<VALUE> implements KVComponent<[number], VALUE> {
1057
1057
  toString(): string;
1058
1058
  }
1059
1059
 
1060
+ /**
1061
+ * `DefaultArray` is an array list where every index is guaranteed to have a value.
1062
+ * There are no undefineds unless that is part of the value type.
1063
+ * When you create `DefaultArray` you give a default value. For example if you
1064
+ * delete an index then that index is set to the default value.
1065
+ */
1066
+ declare class DefaultArray<VALUE> implements KVComponent<[number], VALUE> {
1067
+ readonly defaultValue: VALUE;
1068
+ private data;
1069
+ constructor(values: Iterable<VALUE>, defaultValue: VALUE);
1070
+ constructor(length: number, defaultValue: VALUE);
1071
+ get size(): number;
1072
+ get length(): number;
1073
+ private assertId;
1074
+ isEmpty(): boolean;
1075
+ isDefault(id: number): boolean;
1076
+ isSet(id: number): boolean;
1077
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
1078
+ has(id: number): boolean;
1079
+ set(id: number, value: VALUE): VALUE;
1080
+ get(id: number): VALUE;
1081
+ getOrDefault(id: number, defaultValue: VALUE): VALUE;
1082
+ getOrCreate(id: number, value: VALUE): VALUE;
1083
+ getOrCreate(id: number, creator: () => VALUE): VALUE;
1084
+ delete(id: number): boolean;
1085
+ clear(empty?: boolean): void;
1086
+ forEach(callbackfn: (value: VALUE, id: number, arr: DefaultArray<VALUE>) => void, thisArg?: any): void;
1087
+ indices(): IterableIterator<number>;
1088
+ values(): IterableIterator<VALUE>;
1089
+ entries(): IterableIterator<[number, VALUE]>;
1090
+ indicesArray(): number[];
1091
+ valuesArray(): VALUE[];
1092
+ entriesArray(): [number, VALUE][];
1093
+ kvKeys(): IterableIterator<[number]>;
1094
+ kvValues(): IterableIterator<VALUE>;
1095
+ kvEntries(): IterableIterator<[[number], VALUE]>;
1096
+ [Symbol.iterator](): IterableIterator<[number, VALUE]>;
1097
+ clone(): this;
1098
+ merge(other: DefaultArray<VALUE>, conflictResolver?: (oldValue: VALUE, newValue: VALUE, id: number) => VALUE): this;
1099
+ some(fn: (value: VALUE, id: number) => boolean): boolean;
1100
+ every(fn: (value: VALUE, key1: number) => boolean): boolean;
1101
+ filter<S extends VALUE>(predicate: (value: VALUE, id: number, array: DefaultArray<VALUE>) => value is S): DefaultArray<S>;
1102
+ filter(predicate: (value: VALUE, id: number, array: DefaultArray<VALUE>) => unknown): DefaultArray<VALUE>;
1103
+ reduce(fn: (acc: VALUE, value: VALUE, id: number) => VALUE): VALUE;
1104
+ reduce<R>(fn: (acc: R, value: VALUE, id: number) => R, init: R): R;
1105
+ mapToArray<R>(fn: (value: VALUE, key1: number) => R): R[];
1106
+ map<R = VALUE>(fn: (value: VALUE, key1: number) => R, defaultValue: R): DefaultArray<R>;
1107
+ equals(other: DefaultArray<VALUE>): boolean;
1108
+ equals(other: DefaultArray<VALUE>, eq: (a: VALUE, b: VALUE) => boolean): boolean;
1109
+ toArray(): VALUE[];
1110
+ toString(): string;
1111
+ }
1112
+
1060
1113
  /**
1061
1114
  * A Map implementation mapping a single key to a value.
1062
1115
  */
@@ -1189,6 +1242,79 @@ declare class Map3<KEY1, KEY2, KEY3, VALUE> implements KVComponent<[KEY1, KEY2,
1189
1242
  toString(): string;
1190
1243
  }
1191
1244
 
1245
+ /**
1246
+ * An abstract base class implementation of a Set data structure.
1247
+ */
1248
+ declare abstract class SetBase<VALUE, CLS extends SetBase<VALUE, CLS> = any> implements KVComponent<[VALUE], VALUE> {
1249
+ protected data: Set<VALUE>;
1250
+ constructor(entries?: Iterable<VALUE>);
1251
+ protected abstract valueEquals(a: VALUE, b: VALUE): boolean;
1252
+ protected abstract createEmpty<R = VALUE>(): SetBase<R, any>;
1253
+ protected abstract getName(): string;
1254
+ has(value: VALUE): boolean;
1255
+ add(value: VALUE): VALUE;
1256
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
1257
+ set(key: VALUE, value: VALUE): void;
1258
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
1259
+ get(key: VALUE): VALUE | undefined;
1260
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
1261
+ getOrDefault(key: VALUE, defaultValue: VALUE): VALUE;
1262
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
1263
+ getOrCreate(key: VALUE, value: VALUE): VALUE;
1264
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
1265
+ getOrCreate(key: VALUE, creator: () => VALUE): VALUE;
1266
+ delete(value: VALUE): boolean;
1267
+ clear(): void;
1268
+ get size(): number;
1269
+ isEmpty(): boolean;
1270
+ forEach(callbackfn: (value: VALUE, set1: SetBase<VALUE>) => void, thisArg?: any): void;
1271
+ keys(): IterableIterator<VALUE>;
1272
+ values(): IterableIterator<VALUE>;
1273
+ entries(): IterableIterator<[VALUE, VALUE]>;
1274
+ kvKeys(): IterableIterator<[VALUE]>;
1275
+ kvValues(): IterableIterator<VALUE>;
1276
+ kvEntries(): IterableIterator<[[VALUE], VALUE]>;
1277
+ [Symbol.iterator](): IterableIterator<VALUE>;
1278
+ clone(): SetBase<VALUE>;
1279
+ merge(other: SetBase<VALUE>): this;
1280
+ some(fn: (value: VALUE) => boolean): boolean;
1281
+ every(fn: (value: VALUE) => boolean): boolean;
1282
+ filter<R extends VALUE>(predicate: (value: VALUE, set1: SetBase<VALUE, any>) => value is R): SetBase<R, any>;
1283
+ filter(predicate: (value: VALUE, set1: SetBase<VALUE>) => unknown): SetBase<VALUE, any>;
1284
+ reduce(fn: (acc: VALUE, value: VALUE) => VALUE): VALUE;
1285
+ reduce<R = VALUE>(fn: (acc: R, value: VALUE) => R, init: R): R;
1286
+ mapValues<R = VALUE>(fn: (value: VALUE) => R): SetBase<R, any>;
1287
+ mapToArray<R = VALUE>(fn: (value: VALUE) => R): R[];
1288
+ map<R = VALUE>(fn: (value: VALUE) => R): SetBase<R, any>;
1289
+ toSet(): Set<VALUE>;
1290
+ toArray(): VALUE[];
1291
+ toString(): string;
1292
+ }
1293
+ /**
1294
+ * A simple Set data structure. Comparison of values is done
1295
+ * using === operator (e.g. "a" === "a", but [1, 2] !== [1, 2]).
1296
+ */
1297
+ declare class Set1<VALUE> extends SetBase<VALUE, Set1<VALUE>> {
1298
+ constructor();
1299
+ constructor(set: SetBase<VALUE>);
1300
+ constructor(entries: Iterable<VALUE>);
1301
+ protected createEmpty<R = VALUE>(): Set1<R>;
1302
+ protected valueEquals(a: VALUE, b: VALUE): boolean;
1303
+ protected getName(): string;
1304
+ }
1305
+ /**
1306
+ * A simple Set data structure, where comparison of values is done
1307
+ * using deep equality (e.g. "a" === "a" and also [1, 2] === [1, 2]).
1308
+ */
1309
+ declare class DeepSet<VALUE> extends SetBase<VALUE, DeepSet<VALUE>> {
1310
+ constructor();
1311
+ constructor(set: SetBase<VALUE>);
1312
+ constructor(entries: Iterable<VALUE>);
1313
+ protected createEmpty<R = VALUE>(): DeepSet<R>;
1314
+ protected valueEquals(a: VALUE, b: VALUE): boolean;
1315
+ protected getName(): string;
1316
+ }
1317
+
1192
1318
  /**
1193
1319
  * Wrapper class of a key-value container that contain array values.
1194
1320
  */
@@ -1270,4 +1396,4 @@ declare class SmallIntCache<VALUE> {
1270
1396
  clear(): void;
1271
1397
  }
1272
1398
 
1273
- export { index$7 as Assert, cookies as Cookies, device as Device, DivRect, Guard, IndexArray, type KVComponent, LRUCache, Map1, Map2, Map3, MultiContainer, SignedIndexArray, SmallIntCache, Stack, index as Utils, Vec, Vec2, asMulti };
1399
+ export { index$7 as Assert, cookies as Cookies, DeepSet, DefaultArray, device as Device, DivRect, Guard, IndexArray, type KVComponent, LRUCache, Map1, Map2, Map3, MultiContainer, Set1, SetBase, SignedIndexArray, SmallIntCache, Stack, index as Utils, Vec, Vec2, asMulti };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* TsUtilsLib v1.19.0 | (c) 2023 PahkaSoft | Licensed under the MIT License */
1
+ /* TsUtilsLib v1.19.1 | (c) 2023 PahkaSoft | Licensed under the MIT License */
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -25,6 +25,8 @@ var index_exports = {};
25
25
  __export(index_exports, {
26
26
  Assert: () => assert_exports,
27
27
  Cookies: () => cookies_exports,
28
+ DeepSet: () => DeepSet,
29
+ DefaultArray: () => DefaultArray,
28
30
  Device: () => device_exports,
29
31
  DivRect: () => DivRect,
30
32
  Guard: () => guard_exports,
@@ -34,6 +36,8 @@ __export(index_exports, {
34
36
  Map2: () => Map2,
35
37
  Map3: () => Map3,
36
38
  MultiContainer: () => MultiContainer,
39
+ Set1: () => Set1,
40
+ SetBase: () => SetBase,
37
41
  SignedIndexArray: () => SignedIndexArray,
38
42
  SmallIntCache: () => SmallIntCache,
39
43
  Stack: () => Stack,
@@ -2613,6 +2617,209 @@ var SignedIndexArray = class _SignedIndexArray {
2613
2617
  }
2614
2618
  };
2615
2619
 
2620
+ // src/core/default-array.ts
2621
+ var DefaultArray = class _DefaultArray {
2622
+ constructor(lengthOrValues, defaultValue) {
2623
+ this.defaultValue = defaultValue;
2624
+ __publicField(this, "data");
2625
+ if (typeof lengthOrValues === "number") {
2626
+ this.data = Array(lengthOrValues).fill(defaultValue);
2627
+ } else {
2628
+ this.data = Array.from(lengthOrValues).map(
2629
+ (v) => v === void 0 ? defaultValue : v
2630
+ );
2631
+ }
2632
+ }
2633
+ get size() {
2634
+ return this.data.length;
2635
+ }
2636
+ get length() {
2637
+ return this.data.length;
2638
+ }
2639
+ assertId(id) {
2640
+ if (id < 0 || id >= this.data.length)
2641
+ throw new RangeError(`DefaultArray: Index ${id} out of range`);
2642
+ return id;
2643
+ }
2644
+ isEmpty() {
2645
+ return this.size === 0;
2646
+ }
2647
+ isDefault(id) {
2648
+ return this.data[this.assertId(id)] === this.defaultValue;
2649
+ }
2650
+ isSet(id) {
2651
+ return this.data[this.assertId(id)] !== this.defaultValue;
2652
+ }
2653
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
2654
+ has(id) {
2655
+ return this.isSet(id);
2656
+ }
2657
+ set(id, value) {
2658
+ return this.data[this.assertId(id)] = value;
2659
+ }
2660
+ get(id) {
2661
+ return this.data[this.assertId(id)];
2662
+ }
2663
+ getOrDefault(id, defaultValue) {
2664
+ let value = this.get(id);
2665
+ return value === this.defaultValue ? defaultValue : value;
2666
+ }
2667
+ getOrCreate(id, creatorOrValue) {
2668
+ if (!this.has(id)) {
2669
+ const value = isFunction2(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2670
+ this.set(id, value);
2671
+ return value;
2672
+ }
2673
+ return this.get(id);
2674
+ }
2675
+ delete(id) {
2676
+ this.assertId(id);
2677
+ if (this.data[id] === this.defaultValue) return false;
2678
+ this.data[id] = this.defaultValue;
2679
+ return true;
2680
+ }
2681
+ clear(empty = false) {
2682
+ if (empty)
2683
+ this.data = [];
2684
+ else
2685
+ this.data.fill(this.defaultValue);
2686
+ }
2687
+ forEach(callbackfn, thisArg) {
2688
+ for (const [id, value] of this.entries()) {
2689
+ callbackfn.call(thisArg, value, id, this);
2690
+ }
2691
+ }
2692
+ *indices() {
2693
+ yield* this.data.keys();
2694
+ }
2695
+ *values() {
2696
+ yield* this.data.values();
2697
+ }
2698
+ *entries() {
2699
+ yield* this.data.entries();
2700
+ }
2701
+ indicesArray() {
2702
+ return [...this.indices()];
2703
+ }
2704
+ valuesArray() {
2705
+ return [...this.values()];
2706
+ }
2707
+ entriesArray() {
2708
+ return [...this.entries()];
2709
+ }
2710
+ *kvKeys() {
2711
+ for (const id of this.indices()) {
2712
+ yield [id];
2713
+ }
2714
+ }
2715
+ *kvValues() {
2716
+ for (const value of this.values()) {
2717
+ yield value;
2718
+ }
2719
+ }
2720
+ *kvEntries() {
2721
+ for (const [id, value] of this.entries()) {
2722
+ yield [[id], value];
2723
+ }
2724
+ }
2725
+ *[Symbol.iterator]() {
2726
+ yield* this.entries();
2727
+ }
2728
+ clone() {
2729
+ const ctor = this.constructor;
2730
+ const clone = new ctor(this.length, this.defaultValue);
2731
+ clone.data = this.data.slice();
2732
+ return clone;
2733
+ }
2734
+ merge(other, conflictResolver) {
2735
+ if (this.constructor !== other.constructor)
2736
+ throw new Error(`Cannot merge DefaultArray: different classes (${this.constructor.name} vs ${other.constructor.name})`);
2737
+ if (this.defaultValue !== other.defaultValue)
2738
+ throw new Error(`Cannot merge DefaultArray: different defaultValue (${this.defaultValue} vs ${other.defaultValue})`);
2739
+ for (const [id, value] of other.entries()) {
2740
+ if (this.isDefault(id))
2741
+ this.set(id, value);
2742
+ else if (conflictResolver)
2743
+ this.set(id, conflictResolver(this.get(id), value, id));
2744
+ else
2745
+ this.set(id, value);
2746
+ }
2747
+ return this;
2748
+ }
2749
+ some(fn) {
2750
+ for (const [id, value] of this.entries()) {
2751
+ if (fn(value, id)) return true;
2752
+ }
2753
+ return false;
2754
+ }
2755
+ every(fn) {
2756
+ for (const [id, value] of this.entries()) {
2757
+ if (!fn(value, id)) return false;
2758
+ }
2759
+ return true;
2760
+ }
2761
+ filter(predicate) {
2762
+ const result = new this.constructor(this.length, this.defaultValue);
2763
+ for (const [id, value] of this.entries()) {
2764
+ if (predicate(value, id, this)) result.set(id, value);
2765
+ }
2766
+ return result;
2767
+ }
2768
+ reduce(fn, init) {
2769
+ let iterator = this.entries();
2770
+ let first = iterator.next();
2771
+ if (first.done) {
2772
+ if (arguments.length < 2) {
2773
+ throw new TypeError("Reduce of empty DefaultArray with no initial value!");
2774
+ }
2775
+ return init;
2776
+ }
2777
+ let acc;
2778
+ let start;
2779
+ if (arguments.length < 2) {
2780
+ acc = first.value[1];
2781
+ start = iterator.next();
2782
+ } else {
2783
+ acc = init;
2784
+ start = first;
2785
+ }
2786
+ for (let current = start; !current.done; current = iterator.next()) {
2787
+ const [id, value] = current.value;
2788
+ acc = fn(acc, value, id);
2789
+ }
2790
+ return acc;
2791
+ }
2792
+ mapToArray(fn) {
2793
+ let result = [];
2794
+ for (const [id, value] of this.entries()) {
2795
+ result.push(fn(value, id));
2796
+ }
2797
+ return result;
2798
+ }
2799
+ map(fn, defaultValue) {
2800
+ let result = new _DefaultArray(this.data.length, defaultValue);
2801
+ for (let id = 0; id < this.data.length; id++) {
2802
+ result.data[id] = fn(this.data[id], id);
2803
+ }
2804
+ return result;
2805
+ }
2806
+ equals(other, eq2) {
2807
+ if (this.size !== other.size) return false;
2808
+ eq2 ?? (eq2 = (a, b) => a === b);
2809
+ for (let id = 0; id < this.data.length; ++id) {
2810
+ if (!eq2(this.data[id], other.data[id])) return false;
2811
+ }
2812
+ return true;
2813
+ }
2814
+ toArray() {
2815
+ return this.valuesArray();
2816
+ }
2817
+ toString() {
2818
+ const entries = this.entriesArray().map(([id, v]) => `${formatValue(id)}: ${formatValue(v)}`).join(", ");
2819
+ return `DefaultArray[ ${entries} ]`.replaceAll(" ", " ");
2820
+ }
2821
+ };
2822
+
2616
2823
  // src/core/map1.ts
2617
2824
  var Map1 = class _Map1 {
2618
2825
  constructor(entries) {
@@ -3196,6 +3403,204 @@ var Map3 = class _Map3 {
3196
3403
  }
3197
3404
  };
3198
3405
 
3406
+ // src/core/set.ts
3407
+ var SetBase = class {
3408
+ constructor(entries) {
3409
+ __publicField(this, "data");
3410
+ this.data = new Set(entries ?? []);
3411
+ }
3412
+ has(value) {
3413
+ return this.some((v) => this.valueEquals(v, value));
3414
+ }
3415
+ add(value) {
3416
+ if (!this.has(value))
3417
+ this.data.add(value);
3418
+ return value;
3419
+ }
3420
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
3421
+ set(key, value) {
3422
+ if (!this.valueEquals(key, value))
3423
+ throw new TypeError("SetBase.set() requires key === value.");
3424
+ this.add(value);
3425
+ }
3426
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
3427
+ get(key) {
3428
+ return this.has(key) ? key : void 0;
3429
+ }
3430
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
3431
+ getOrDefault(key, defaultValue) {
3432
+ return this.get(key) ?? defaultValue;
3433
+ }
3434
+ getOrCreate(key, creatorOrValue) {
3435
+ if (!this.has(key)) {
3436
+ const value = isFunction2(creatorOrValue) ? creatorOrValue() : creatorOrValue;
3437
+ this.set(key, value);
3438
+ return value;
3439
+ }
3440
+ return this.get(key);
3441
+ }
3442
+ delete(value) {
3443
+ if (!this.has(value)) return false;
3444
+ for (const v of this.values()) {
3445
+ if (this.valueEquals(v, value)) {
3446
+ this.data.delete(v);
3447
+ return true;
3448
+ }
3449
+ }
3450
+ return false;
3451
+ }
3452
+ clear() {
3453
+ this.data.clear();
3454
+ }
3455
+ get size() {
3456
+ return this.data.size;
3457
+ }
3458
+ isEmpty() {
3459
+ return this.size === 0;
3460
+ }
3461
+ forEach(callbackfn, thisArg) {
3462
+ this.data.forEach((value) => callbackfn.call(thisArg, value, this));
3463
+ }
3464
+ *keys() {
3465
+ yield* this.data.keys();
3466
+ }
3467
+ *values() {
3468
+ yield* this.data.values();
3469
+ }
3470
+ *entries() {
3471
+ yield* this.data.entries();
3472
+ }
3473
+ *kvKeys() {
3474
+ for (const key of this.keys()) {
3475
+ yield [key];
3476
+ }
3477
+ }
3478
+ *kvValues() {
3479
+ for (const el of this.values()) {
3480
+ yield el;
3481
+ }
3482
+ }
3483
+ *kvEntries() {
3484
+ for (const [key, el] of this.entries()) {
3485
+ yield [[key], el];
3486
+ }
3487
+ }
3488
+ *[Symbol.iterator]() {
3489
+ yield* this.values();
3490
+ }
3491
+ clone() {
3492
+ const result = this.createEmpty();
3493
+ for (const v of this.values()) result.add(v);
3494
+ return result;
3495
+ }
3496
+ merge(other) {
3497
+ for (const value of other.values()) {
3498
+ this.add(value);
3499
+ }
3500
+ return this;
3501
+ }
3502
+ some(fn) {
3503
+ for (const value of this.data) {
3504
+ if (fn(value)) return true;
3505
+ }
3506
+ return false;
3507
+ }
3508
+ every(fn) {
3509
+ for (const value of this.data) {
3510
+ if (!fn(value)) return false;
3511
+ }
3512
+ return true;
3513
+ }
3514
+ filter(predicate) {
3515
+ const result = this.createEmpty();
3516
+ for (const value of this.data)
3517
+ if (predicate(value, this)) result.add(value);
3518
+ return result;
3519
+ }
3520
+ reduce(fn, init) {
3521
+ let iterator = this.values();
3522
+ let first = iterator.next();
3523
+ if (first.done) {
3524
+ if (arguments.length < 2) {
3525
+ throw new TypeError("Reduce of empty SetBase with no initial value!");
3526
+ }
3527
+ return init;
3528
+ }
3529
+ let acc;
3530
+ let start;
3531
+ if (arguments.length < 2) {
3532
+ acc = first.value;
3533
+ start = iterator.next();
3534
+ } else {
3535
+ acc = init;
3536
+ start = first;
3537
+ }
3538
+ for (let current = start; !current.done; current = iterator.next()) {
3539
+ const value = current.value;
3540
+ acc = fn(acc, value);
3541
+ }
3542
+ return acc;
3543
+ }
3544
+ mapValues(fn) {
3545
+ let result = this.createEmpty();
3546
+ for (const value of this.data) {
3547
+ result.add(fn(value));
3548
+ }
3549
+ return result;
3550
+ }
3551
+ mapToArray(fn) {
3552
+ let result = [];
3553
+ for (const value of this.values()) {
3554
+ result.push(fn(value));
3555
+ }
3556
+ return result;
3557
+ }
3558
+ map(fn) {
3559
+ let result = this.createEmpty();
3560
+ for (const value of this.values()) {
3561
+ result.add(fn(value));
3562
+ }
3563
+ return result;
3564
+ }
3565
+ toSet() {
3566
+ return new Set(this.data);
3567
+ }
3568
+ toArray() {
3569
+ return [...this.values()];
3570
+ }
3571
+ toString() {
3572
+ return `${this.getName()}(${this.size})${formatValue([...this.data])}`.replaceAll(" ", " ");
3573
+ }
3574
+ };
3575
+ var Set1 = class _Set1 extends SetBase {
3576
+ constructor(entries) {
3577
+ super(entries);
3578
+ }
3579
+ createEmpty() {
3580
+ return new _Set1();
3581
+ }
3582
+ valueEquals(a, b) {
3583
+ return a === b;
3584
+ }
3585
+ getName() {
3586
+ return "Set1";
3587
+ }
3588
+ };
3589
+ var DeepSet = class _DeepSet extends SetBase {
3590
+ constructor(entries) {
3591
+ super(entries);
3592
+ }
3593
+ createEmpty() {
3594
+ return new _DeepSet();
3595
+ }
3596
+ valueEquals(a, b) {
3597
+ return isDeepEqual2(a, b);
3598
+ }
3599
+ getName() {
3600
+ return "DeepSet";
3601
+ }
3602
+ };
3603
+
3199
3604
  // src/core/multi-container.ts
3200
3605
  var MultiContainer = class {
3201
3606
  constructor(base) {
@@ -3345,6 +3750,8 @@ var SmallIntCache = class {
3345
3750
  0 && (module.exports = {
3346
3751
  Assert,
3347
3752
  Cookies,
3753
+ DeepSet,
3754
+ DefaultArray,
3348
3755
  Device,
3349
3756
  DivRect,
3350
3757
  Guard,
@@ -3354,6 +3761,8 @@ var SmallIntCache = class {
3354
3761
  Map2,
3355
3762
  Map3,
3356
3763
  MultiContainer,
3764
+ Set1,
3765
+ SetBase,
3357
3766
  SignedIndexArray,
3358
3767
  SmallIntCache,
3359
3768
  Stack,
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /* TsUtilsLib v1.19.0 | (c) 2023 PahkaSoft | Licensed under the MIT License */
1
+ /* TsUtilsLib v1.19.1 | (c) 2023 PahkaSoft | Licensed under the MIT License */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __export = (target, all) => {
@@ -2576,6 +2576,209 @@ var SignedIndexArray = class _SignedIndexArray {
2576
2576
  }
2577
2577
  };
2578
2578
 
2579
+ // src/core/default-array.ts
2580
+ var DefaultArray = class _DefaultArray {
2581
+ constructor(lengthOrValues, defaultValue) {
2582
+ this.defaultValue = defaultValue;
2583
+ __publicField(this, "data");
2584
+ if (typeof lengthOrValues === "number") {
2585
+ this.data = Array(lengthOrValues).fill(defaultValue);
2586
+ } else {
2587
+ this.data = Array.from(lengthOrValues).map(
2588
+ (v) => v === void 0 ? defaultValue : v
2589
+ );
2590
+ }
2591
+ }
2592
+ get size() {
2593
+ return this.data.length;
2594
+ }
2595
+ get length() {
2596
+ return this.data.length;
2597
+ }
2598
+ assertId(id) {
2599
+ if (id < 0 || id >= this.data.length)
2600
+ throw new RangeError(`DefaultArray: Index ${id} out of range`);
2601
+ return id;
2602
+ }
2603
+ isEmpty() {
2604
+ return this.size === 0;
2605
+ }
2606
+ isDefault(id) {
2607
+ return this.data[this.assertId(id)] === this.defaultValue;
2608
+ }
2609
+ isSet(id) {
2610
+ return this.data[this.assertId(id)] !== this.defaultValue;
2611
+ }
2612
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
2613
+ has(id) {
2614
+ return this.isSet(id);
2615
+ }
2616
+ set(id, value) {
2617
+ return this.data[this.assertId(id)] = value;
2618
+ }
2619
+ get(id) {
2620
+ return this.data[this.assertId(id)];
2621
+ }
2622
+ getOrDefault(id, defaultValue) {
2623
+ let value = this.get(id);
2624
+ return value === this.defaultValue ? defaultValue : value;
2625
+ }
2626
+ getOrCreate(id, creatorOrValue) {
2627
+ if (!this.has(id)) {
2628
+ const value = isFunction2(creatorOrValue) ? creatorOrValue() : creatorOrValue;
2629
+ this.set(id, value);
2630
+ return value;
2631
+ }
2632
+ return this.get(id);
2633
+ }
2634
+ delete(id) {
2635
+ this.assertId(id);
2636
+ if (this.data[id] === this.defaultValue) return false;
2637
+ this.data[id] = this.defaultValue;
2638
+ return true;
2639
+ }
2640
+ clear(empty = false) {
2641
+ if (empty)
2642
+ this.data = [];
2643
+ else
2644
+ this.data.fill(this.defaultValue);
2645
+ }
2646
+ forEach(callbackfn, thisArg) {
2647
+ for (const [id, value] of this.entries()) {
2648
+ callbackfn.call(thisArg, value, id, this);
2649
+ }
2650
+ }
2651
+ *indices() {
2652
+ yield* this.data.keys();
2653
+ }
2654
+ *values() {
2655
+ yield* this.data.values();
2656
+ }
2657
+ *entries() {
2658
+ yield* this.data.entries();
2659
+ }
2660
+ indicesArray() {
2661
+ return [...this.indices()];
2662
+ }
2663
+ valuesArray() {
2664
+ return [...this.values()];
2665
+ }
2666
+ entriesArray() {
2667
+ return [...this.entries()];
2668
+ }
2669
+ *kvKeys() {
2670
+ for (const id of this.indices()) {
2671
+ yield [id];
2672
+ }
2673
+ }
2674
+ *kvValues() {
2675
+ for (const value of this.values()) {
2676
+ yield value;
2677
+ }
2678
+ }
2679
+ *kvEntries() {
2680
+ for (const [id, value] of this.entries()) {
2681
+ yield [[id], value];
2682
+ }
2683
+ }
2684
+ *[Symbol.iterator]() {
2685
+ yield* this.entries();
2686
+ }
2687
+ clone() {
2688
+ const ctor = this.constructor;
2689
+ const clone = new ctor(this.length, this.defaultValue);
2690
+ clone.data = this.data.slice();
2691
+ return clone;
2692
+ }
2693
+ merge(other, conflictResolver) {
2694
+ if (this.constructor !== other.constructor)
2695
+ throw new Error(`Cannot merge DefaultArray: different classes (${this.constructor.name} vs ${other.constructor.name})`);
2696
+ if (this.defaultValue !== other.defaultValue)
2697
+ throw new Error(`Cannot merge DefaultArray: different defaultValue (${this.defaultValue} vs ${other.defaultValue})`);
2698
+ for (const [id, value] of other.entries()) {
2699
+ if (this.isDefault(id))
2700
+ this.set(id, value);
2701
+ else if (conflictResolver)
2702
+ this.set(id, conflictResolver(this.get(id), value, id));
2703
+ else
2704
+ this.set(id, value);
2705
+ }
2706
+ return this;
2707
+ }
2708
+ some(fn) {
2709
+ for (const [id, value] of this.entries()) {
2710
+ if (fn(value, id)) return true;
2711
+ }
2712
+ return false;
2713
+ }
2714
+ every(fn) {
2715
+ for (const [id, value] of this.entries()) {
2716
+ if (!fn(value, id)) return false;
2717
+ }
2718
+ return true;
2719
+ }
2720
+ filter(predicate) {
2721
+ const result = new this.constructor(this.length, this.defaultValue);
2722
+ for (const [id, value] of this.entries()) {
2723
+ if (predicate(value, id, this)) result.set(id, value);
2724
+ }
2725
+ return result;
2726
+ }
2727
+ reduce(fn, init) {
2728
+ let iterator = this.entries();
2729
+ let first = iterator.next();
2730
+ if (first.done) {
2731
+ if (arguments.length < 2) {
2732
+ throw new TypeError("Reduce of empty DefaultArray with no initial value!");
2733
+ }
2734
+ return init;
2735
+ }
2736
+ let acc;
2737
+ let start;
2738
+ if (arguments.length < 2) {
2739
+ acc = first.value[1];
2740
+ start = iterator.next();
2741
+ } else {
2742
+ acc = init;
2743
+ start = first;
2744
+ }
2745
+ for (let current = start; !current.done; current = iterator.next()) {
2746
+ const [id, value] = current.value;
2747
+ acc = fn(acc, value, id);
2748
+ }
2749
+ return acc;
2750
+ }
2751
+ mapToArray(fn) {
2752
+ let result = [];
2753
+ for (const [id, value] of this.entries()) {
2754
+ result.push(fn(value, id));
2755
+ }
2756
+ return result;
2757
+ }
2758
+ map(fn, defaultValue) {
2759
+ let result = new _DefaultArray(this.data.length, defaultValue);
2760
+ for (let id = 0; id < this.data.length; id++) {
2761
+ result.data[id] = fn(this.data[id], id);
2762
+ }
2763
+ return result;
2764
+ }
2765
+ equals(other, eq2) {
2766
+ if (this.size !== other.size) return false;
2767
+ eq2 ?? (eq2 = (a, b) => a === b);
2768
+ for (let id = 0; id < this.data.length; ++id) {
2769
+ if (!eq2(this.data[id], other.data[id])) return false;
2770
+ }
2771
+ return true;
2772
+ }
2773
+ toArray() {
2774
+ return this.valuesArray();
2775
+ }
2776
+ toString() {
2777
+ const entries = this.entriesArray().map(([id, v]) => `${formatValue(id)}: ${formatValue(v)}`).join(", ");
2778
+ return `DefaultArray[ ${entries} ]`.replaceAll(" ", " ");
2779
+ }
2780
+ };
2781
+
2579
2782
  // src/core/map1.ts
2580
2783
  var Map1 = class _Map1 {
2581
2784
  constructor(entries) {
@@ -3159,6 +3362,204 @@ var Map3 = class _Map3 {
3159
3362
  }
3160
3363
  };
3161
3364
 
3365
+ // src/core/set.ts
3366
+ var SetBase = class {
3367
+ constructor(entries) {
3368
+ __publicField(this, "data");
3369
+ this.data = new Set(entries ?? []);
3370
+ }
3371
+ has(value) {
3372
+ return this.some((v) => this.valueEquals(v, value));
3373
+ }
3374
+ add(value) {
3375
+ if (!this.has(value))
3376
+ this.data.add(value);
3377
+ return value;
3378
+ }
3379
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
3380
+ set(key, value) {
3381
+ if (!this.valueEquals(key, value))
3382
+ throw new TypeError("SetBase.set() requires key === value.");
3383
+ this.add(value);
3384
+ }
3385
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
3386
+ get(key) {
3387
+ return this.has(key) ? key : void 0;
3388
+ }
3389
+ /** @internal - This method exists only for interface `KVComponent` compatibility.*/
3390
+ getOrDefault(key, defaultValue) {
3391
+ return this.get(key) ?? defaultValue;
3392
+ }
3393
+ getOrCreate(key, creatorOrValue) {
3394
+ if (!this.has(key)) {
3395
+ const value = isFunction2(creatorOrValue) ? creatorOrValue() : creatorOrValue;
3396
+ this.set(key, value);
3397
+ return value;
3398
+ }
3399
+ return this.get(key);
3400
+ }
3401
+ delete(value) {
3402
+ if (!this.has(value)) return false;
3403
+ for (const v of this.values()) {
3404
+ if (this.valueEquals(v, value)) {
3405
+ this.data.delete(v);
3406
+ return true;
3407
+ }
3408
+ }
3409
+ return false;
3410
+ }
3411
+ clear() {
3412
+ this.data.clear();
3413
+ }
3414
+ get size() {
3415
+ return this.data.size;
3416
+ }
3417
+ isEmpty() {
3418
+ return this.size === 0;
3419
+ }
3420
+ forEach(callbackfn, thisArg) {
3421
+ this.data.forEach((value) => callbackfn.call(thisArg, value, this));
3422
+ }
3423
+ *keys() {
3424
+ yield* this.data.keys();
3425
+ }
3426
+ *values() {
3427
+ yield* this.data.values();
3428
+ }
3429
+ *entries() {
3430
+ yield* this.data.entries();
3431
+ }
3432
+ *kvKeys() {
3433
+ for (const key of this.keys()) {
3434
+ yield [key];
3435
+ }
3436
+ }
3437
+ *kvValues() {
3438
+ for (const el of this.values()) {
3439
+ yield el;
3440
+ }
3441
+ }
3442
+ *kvEntries() {
3443
+ for (const [key, el] of this.entries()) {
3444
+ yield [[key], el];
3445
+ }
3446
+ }
3447
+ *[Symbol.iterator]() {
3448
+ yield* this.values();
3449
+ }
3450
+ clone() {
3451
+ const result = this.createEmpty();
3452
+ for (const v of this.values()) result.add(v);
3453
+ return result;
3454
+ }
3455
+ merge(other) {
3456
+ for (const value of other.values()) {
3457
+ this.add(value);
3458
+ }
3459
+ return this;
3460
+ }
3461
+ some(fn) {
3462
+ for (const value of this.data) {
3463
+ if (fn(value)) return true;
3464
+ }
3465
+ return false;
3466
+ }
3467
+ every(fn) {
3468
+ for (const value of this.data) {
3469
+ if (!fn(value)) return false;
3470
+ }
3471
+ return true;
3472
+ }
3473
+ filter(predicate) {
3474
+ const result = this.createEmpty();
3475
+ for (const value of this.data)
3476
+ if (predicate(value, this)) result.add(value);
3477
+ return result;
3478
+ }
3479
+ reduce(fn, init) {
3480
+ let iterator = this.values();
3481
+ let first = iterator.next();
3482
+ if (first.done) {
3483
+ if (arguments.length < 2) {
3484
+ throw new TypeError("Reduce of empty SetBase with no initial value!");
3485
+ }
3486
+ return init;
3487
+ }
3488
+ let acc;
3489
+ let start;
3490
+ if (arguments.length < 2) {
3491
+ acc = first.value;
3492
+ start = iterator.next();
3493
+ } else {
3494
+ acc = init;
3495
+ start = first;
3496
+ }
3497
+ for (let current = start; !current.done; current = iterator.next()) {
3498
+ const value = current.value;
3499
+ acc = fn(acc, value);
3500
+ }
3501
+ return acc;
3502
+ }
3503
+ mapValues(fn) {
3504
+ let result = this.createEmpty();
3505
+ for (const value of this.data) {
3506
+ result.add(fn(value));
3507
+ }
3508
+ return result;
3509
+ }
3510
+ mapToArray(fn) {
3511
+ let result = [];
3512
+ for (const value of this.values()) {
3513
+ result.push(fn(value));
3514
+ }
3515
+ return result;
3516
+ }
3517
+ map(fn) {
3518
+ let result = this.createEmpty();
3519
+ for (const value of this.values()) {
3520
+ result.add(fn(value));
3521
+ }
3522
+ return result;
3523
+ }
3524
+ toSet() {
3525
+ return new Set(this.data);
3526
+ }
3527
+ toArray() {
3528
+ return [...this.values()];
3529
+ }
3530
+ toString() {
3531
+ return `${this.getName()}(${this.size})${formatValue([...this.data])}`.replaceAll(" ", " ");
3532
+ }
3533
+ };
3534
+ var Set1 = class _Set1 extends SetBase {
3535
+ constructor(entries) {
3536
+ super(entries);
3537
+ }
3538
+ createEmpty() {
3539
+ return new _Set1();
3540
+ }
3541
+ valueEquals(a, b) {
3542
+ return a === b;
3543
+ }
3544
+ getName() {
3545
+ return "Set1";
3546
+ }
3547
+ };
3548
+ var DeepSet = class _DeepSet extends SetBase {
3549
+ constructor(entries) {
3550
+ super(entries);
3551
+ }
3552
+ createEmpty() {
3553
+ return new _DeepSet();
3554
+ }
3555
+ valueEquals(a, b) {
3556
+ return isDeepEqual2(a, b);
3557
+ }
3558
+ getName() {
3559
+ return "DeepSet";
3560
+ }
3561
+ };
3562
+
3162
3563
  // src/core/multi-container.ts
3163
3564
  var MultiContainer = class {
3164
3565
  constructor(base) {
@@ -3307,6 +3708,8 @@ var SmallIntCache = class {
3307
3708
  export {
3308
3709
  assert_exports as Assert,
3309
3710
  cookies_exports as Cookies,
3711
+ DeepSet,
3712
+ DefaultArray,
3310
3713
  device_exports as Device,
3311
3714
  DivRect,
3312
3715
  guard_exports as Guard,
@@ -3316,6 +3719,8 @@ export {
3316
3719
  Map2,
3317
3720
  Map3,
3318
3721
  MultiContainer,
3722
+ Set1,
3723
+ SetBase,
3319
3724
  SignedIndexArray,
3320
3725
  SmallIntCache,
3321
3726
  Stack,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tspro/ts-utils-lib",
3
- "version": "1.19.0",
3
+ "version": "1.19.1",
4
4
  "author": "PahkaSoft",
5
5
  "license": "MIT",
6
6
  "private": false,