ts-data-forge 1.0.0 → 1.0.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/README.md +1 -1
- package/dist/array/array-utils.d.mts +2617 -0
- package/dist/array/array-utils.d.mts.map +1 -0
- package/dist/array/array-utils.mjs +2915 -0
- package/dist/array/array-utils.mjs.map +1 -0
- package/dist/array/index.d.mts +3 -0
- package/dist/array/index.d.mts.map +1 -0
- package/dist/array/index.mjs +3 -0
- package/dist/array/index.mjs.map +1 -0
- package/dist/array/tuple-utils.d.mts +421 -0
- package/dist/array/tuple-utils.d.mts.map +1 -0
- package/dist/array/tuple-utils.mjs +391 -0
- package/dist/array/tuple-utils.mjs.map +1 -0
- package/dist/collections/imap-mapped.d.mts +445 -0
- package/dist/collections/imap-mapped.d.mts.map +1 -0
- package/dist/collections/imap-mapped.mjs +424 -0
- package/dist/collections/imap-mapped.mjs.map +1 -0
- package/dist/collections/imap.d.mts +359 -0
- package/dist/collections/imap.d.mts.map +1 -0
- package/dist/collections/imap.mjs +338 -0
- package/dist/collections/imap.mjs.map +1 -0
- package/dist/collections/index.d.mts +7 -0
- package/dist/collections/index.d.mts.map +1 -0
- package/dist/collections/index.mjs +7 -0
- package/dist/collections/index.mjs.map +1 -0
- package/dist/collections/iset-mapped.d.mts +576 -0
- package/dist/collections/iset-mapped.d.mts.map +1 -0
- package/dist/collections/iset-mapped.mjs +522 -0
- package/dist/collections/iset-mapped.mjs.map +1 -0
- package/dist/collections/iset.d.mts +426 -0
- package/dist/collections/iset.d.mts.map +1 -0
- package/dist/collections/iset.mjs +437 -0
- package/dist/collections/iset.mjs.map +1 -0
- package/dist/collections/queue.d.mts +190 -0
- package/dist/collections/queue.d.mts.map +1 -0
- package/dist/collections/queue.mjs +317 -0
- package/dist/collections/queue.mjs.map +1 -0
- package/dist/collections/stack.d.mts +210 -0
- package/dist/collections/stack.d.mts.map +1 -0
- package/dist/collections/stack.mjs +353 -0
- package/dist/collections/stack.mjs.map +1 -0
- package/dist/expect-type.d.mts +199 -0
- package/dist/expect-type.d.mts.map +1 -0
- package/dist/expect-type.mjs +201 -0
- package/dist/expect-type.mjs.map +1 -0
- package/dist/functional/index.d.mts +5 -0
- package/dist/functional/index.d.mts.map +1 -0
- package/dist/functional/index.mjs +5 -0
- package/dist/functional/index.mjs.map +1 -0
- package/dist/functional/match.d.mts +215 -0
- package/dist/functional/match.d.mts.map +1 -0
- package/dist/functional/match.mjs +139 -0
- package/dist/functional/match.mjs.map +1 -0
- package/dist/functional/optional.d.mts +517 -0
- package/dist/functional/optional.d.mts.map +1 -0
- package/dist/functional/optional.mjs +532 -0
- package/dist/functional/optional.mjs.map +1 -0
- package/dist/functional/pipe.d.mts +185 -0
- package/dist/functional/pipe.d.mts.map +1 -0
- package/dist/functional/pipe.mjs +129 -0
- package/dist/functional/pipe.mjs.map +1 -0
- package/dist/functional/result.d.mts +796 -0
- package/dist/functional/result.d.mts.map +1 -0
- package/dist/functional/result.mjs +844 -0
- package/dist/functional/result.mjs.map +1 -0
- package/dist/globals.d.mts +38 -0
- package/dist/guard/has-key.d.mts +100 -0
- package/dist/guard/has-key.d.mts.map +1 -0
- package/dist/guard/has-key.mjs +94 -0
- package/dist/guard/has-key.mjs.map +1 -0
- package/dist/guard/index.d.mts +8 -0
- package/dist/guard/index.d.mts.map +1 -0
- package/dist/guard/index.mjs +8 -0
- package/dist/guard/index.mjs.map +1 -0
- package/dist/guard/is-non-empty-string.d.mts +106 -0
- package/dist/guard/is-non-empty-string.d.mts.map +1 -0
- package/dist/guard/is-non-empty-string.mjs +108 -0
- package/dist/guard/is-non-empty-string.mjs.map +1 -0
- package/dist/guard/is-non-null-object.d.mts +105 -0
- package/dist/guard/is-non-null-object.d.mts.map +1 -0
- package/dist/guard/is-non-null-object.mjs +108 -0
- package/dist/guard/is-non-null-object.mjs.map +1 -0
- package/dist/guard/is-primitive.d.mts +146 -0
- package/dist/guard/is-primitive.d.mts.map +1 -0
- package/dist/guard/is-primitive.mjs +161 -0
- package/dist/guard/is-primitive.mjs.map +1 -0
- package/dist/guard/is-record.d.mts +151 -0
- package/dist/guard/is-record.d.mts.map +1 -0
- package/dist/guard/is-record.mjs +155 -0
- package/dist/guard/is-record.mjs.map +1 -0
- package/dist/guard/is-type.d.mts +430 -0
- package/dist/guard/is-type.d.mts.map +1 -0
- package/dist/guard/is-type.mjs +432 -0
- package/dist/guard/is-type.mjs.map +1 -0
- package/dist/guard/key-is-in.d.mts +158 -0
- package/dist/guard/key-is-in.d.mts.map +1 -0
- package/dist/guard/key-is-in.mjs +160 -0
- package/dist/guard/key-is-in.mjs.map +1 -0
- package/dist/index.d.mts +11 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +61 -0
- package/dist/index.mjs.map +1 -0
- package/dist/iterator/index.d.mts +2 -0
- package/dist/iterator/index.d.mts.map +1 -0
- package/dist/iterator/index.mjs +2 -0
- package/dist/iterator/index.mjs.map +1 -0
- package/dist/iterator/range.d.mts +97 -0
- package/dist/iterator/range.d.mts.map +1 -0
- package/dist/iterator/range.mjs +130 -0
- package/dist/iterator/range.mjs.map +1 -0
- package/dist/json/index.d.mts +2 -0
- package/dist/json/index.d.mts.map +1 -0
- package/dist/json/index.mjs +2 -0
- package/dist/json/index.mjs.map +1 -0
- package/dist/json/json.d.mts +597 -0
- package/dist/json/json.d.mts.map +1 -0
- package/dist/json/json.mjs +687 -0
- package/dist/json/json.mjs.map +1 -0
- package/dist/number/branded-types/finite-number.d.mts +291 -0
- package/dist/number/branded-types/finite-number.d.mts.map +1 -0
- package/dist/number/branded-types/finite-number.mjs +296 -0
- package/dist/number/branded-types/finite-number.mjs.map +1 -0
- package/dist/number/branded-types/index.d.mts +27 -0
- package/dist/number/branded-types/index.d.mts.map +1 -0
- package/dist/number/branded-types/index.mjs +27 -0
- package/dist/number/branded-types/index.mjs.map +1 -0
- package/dist/number/branded-types/int.d.mts +242 -0
- package/dist/number/branded-types/int.d.mts.map +1 -0
- package/dist/number/branded-types/int.mjs +239 -0
- package/dist/number/branded-types/int.mjs.map +1 -0
- package/dist/number/branded-types/int16.d.mts +162 -0
- package/dist/number/branded-types/int16.d.mts.map +1 -0
- package/dist/number/branded-types/int16.mjs +141 -0
- package/dist/number/branded-types/int16.mjs.map +1 -0
- package/dist/number/branded-types/int32.d.mts +155 -0
- package/dist/number/branded-types/int32.d.mts.map +1 -0
- package/dist/number/branded-types/int32.mjs +142 -0
- package/dist/number/branded-types/int32.mjs.map +1 -0
- package/dist/number/branded-types/non-negative-finite-number.d.mts +165 -0
- package/dist/number/branded-types/non-negative-finite-number.d.mts.map +1 -0
- package/dist/number/branded-types/non-negative-finite-number.mjs +160 -0
- package/dist/number/branded-types/non-negative-finite-number.mjs.map +1 -0
- package/dist/number/branded-types/non-negative-int16.d.mts +160 -0
- package/dist/number/branded-types/non-negative-int16.d.mts.map +1 -0
- package/dist/number/branded-types/non-negative-int16.mjs +138 -0
- package/dist/number/branded-types/non-negative-int16.mjs.map +1 -0
- package/dist/number/branded-types/non-negative-int32.d.mts +156 -0
- package/dist/number/branded-types/non-negative-int32.d.mts.map +1 -0
- package/dist/number/branded-types/non-negative-int32.mjs +138 -0
- package/dist/number/branded-types/non-negative-int32.mjs.map +1 -0
- package/dist/number/branded-types/non-zero-finite-number.d.mts +154 -0
- package/dist/number/branded-types/non-zero-finite-number.d.mts.map +1 -0
- package/dist/number/branded-types/non-zero-finite-number.mjs +160 -0
- package/dist/number/branded-types/non-zero-finite-number.mjs.map +1 -0
- package/dist/number/branded-types/non-zero-int.d.mts +131 -0
- package/dist/number/branded-types/non-zero-int.d.mts.map +1 -0
- package/dist/number/branded-types/non-zero-int.mjs +128 -0
- package/dist/number/branded-types/non-zero-int.mjs.map +1 -0
- package/dist/number/branded-types/non-zero-int16.d.mts +166 -0
- package/dist/number/branded-types/non-zero-int16.d.mts.map +1 -0
- package/dist/number/branded-types/non-zero-int16.mjs +145 -0
- package/dist/number/branded-types/non-zero-int16.mjs.map +1 -0
- package/dist/number/branded-types/non-zero-int32.d.mts +158 -0
- package/dist/number/branded-types/non-zero-int32.d.mts.map +1 -0
- package/dist/number/branded-types/non-zero-int32.mjs +145 -0
- package/dist/number/branded-types/non-zero-int32.mjs.map +1 -0
- package/dist/number/branded-types/non-zero-safe-int.d.mts +148 -0
- package/dist/number/branded-types/non-zero-safe-int.d.mts.map +1 -0
- package/dist/number/branded-types/non-zero-safe-int.mjs +145 -0
- package/dist/number/branded-types/non-zero-safe-int.mjs.map +1 -0
- package/dist/number/branded-types/non-zero-uint16.d.mts +160 -0
- package/dist/number/branded-types/non-zero-uint16.d.mts.map +1 -0
- package/dist/number/branded-types/non-zero-uint16.mjs +140 -0
- package/dist/number/branded-types/non-zero-uint16.mjs.map +1 -0
- package/dist/number/branded-types/non-zero-uint32.d.mts +156 -0
- package/dist/number/branded-types/non-zero-uint32.d.mts.map +1 -0
- package/dist/number/branded-types/non-zero-uint32.mjs +140 -0
- package/dist/number/branded-types/non-zero-uint32.mjs.map +1 -0
- package/dist/number/branded-types/positive-finite-number.d.mts +171 -0
- package/dist/number/branded-types/positive-finite-number.d.mts.map +1 -0
- package/dist/number/branded-types/positive-finite-number.mjs +165 -0
- package/dist/number/branded-types/positive-finite-number.mjs.map +1 -0
- package/dist/number/branded-types/positive-int.d.mts +270 -0
- package/dist/number/branded-types/positive-int.d.mts.map +1 -0
- package/dist/number/branded-types/positive-int.mjs +257 -0
- package/dist/number/branded-types/positive-int.mjs.map +1 -0
- package/dist/number/branded-types/positive-int16.d.mts +162 -0
- package/dist/number/branded-types/positive-int16.d.mts.map +1 -0
- package/dist/number/branded-types/positive-int16.mjs +139 -0
- package/dist/number/branded-types/positive-int16.mjs.map +1 -0
- package/dist/number/branded-types/positive-int32.d.mts +158 -0
- package/dist/number/branded-types/positive-int32.d.mts.map +1 -0
- package/dist/number/branded-types/positive-int32.mjs +139 -0
- package/dist/number/branded-types/positive-int32.mjs.map +1 -0
- package/dist/number/branded-types/positive-safe-int.d.mts +152 -0
- package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -0
- package/dist/number/branded-types/positive-safe-int.mjs +138 -0
- package/dist/number/branded-types/positive-safe-int.mjs.map +1 -0
- package/dist/number/branded-types/positive-uint16.d.mts +160 -0
- package/dist/number/branded-types/positive-uint16.d.mts.map +1 -0
- package/dist/number/branded-types/positive-uint16.mjs +139 -0
- package/dist/number/branded-types/positive-uint16.mjs.map +1 -0
- package/dist/number/branded-types/positive-uint32.d.mts +156 -0
- package/dist/number/branded-types/positive-uint32.d.mts.map +1 -0
- package/dist/number/branded-types/positive-uint32.mjs +139 -0
- package/dist/number/branded-types/positive-uint32.mjs.map +1 -0
- package/dist/number/branded-types/safe-int.d.mts +243 -0
- package/dist/number/branded-types/safe-int.d.mts.map +1 -0
- package/dist/number/branded-types/safe-int.mjs +240 -0
- package/dist/number/branded-types/safe-int.mjs.map +1 -0
- package/dist/number/branded-types/safe-uint.d.mts +151 -0
- package/dist/number/branded-types/safe-uint.d.mts.map +1 -0
- package/dist/number/branded-types/safe-uint.mjs +138 -0
- package/dist/number/branded-types/safe-uint.mjs.map +1 -0
- package/dist/number/branded-types/uint.d.mts +144 -0
- package/dist/number/branded-types/uint.d.mts.map +1 -0
- package/dist/number/branded-types/uint.mjs +132 -0
- package/dist/number/branded-types/uint.mjs.map +1 -0
- package/dist/number/branded-types/uint16.d.mts +157 -0
- package/dist/number/branded-types/uint16.d.mts.map +1 -0
- package/dist/number/branded-types/uint16.mjs +137 -0
- package/dist/number/branded-types/uint16.mjs.map +1 -0
- package/dist/number/branded-types/uint32.d.mts +185 -0
- package/dist/number/branded-types/uint32.d.mts.map +1 -0
- package/dist/number/branded-types/uint32.mjs +169 -0
- package/dist/number/branded-types/uint32.mjs.map +1 -0
- package/dist/number/enum/index.d.mts +3 -0
- package/dist/number/enum/index.d.mts.map +1 -0
- package/dist/number/enum/index.mjs +3 -0
- package/dist/number/enum/index.mjs.map +1 -0
- package/dist/number/enum/int8.d.mts +202 -0
- package/dist/number/enum/int8.d.mts.map +1 -0
- package/dist/number/enum/int8.mjs +296 -0
- package/dist/number/enum/int8.mjs.map +1 -0
- package/dist/number/enum/uint8.d.mts +128 -0
- package/dist/number/enum/uint8.d.mts.map +1 -0
- package/dist/number/enum/uint8.mjs +251 -0
- package/dist/number/enum/uint8.mjs.map +1 -0
- package/dist/number/index.d.mts +5 -0
- package/dist/number/index.d.mts.map +1 -0
- package/dist/number/index.mjs +31 -0
- package/dist/number/index.mjs.map +1 -0
- package/dist/number/num.d.mts +515 -0
- package/dist/number/num.d.mts.map +1 -0
- package/dist/number/num.mjs +513 -0
- package/dist/number/num.mjs.map +1 -0
- package/dist/number/refined-number-utils.d.mts +191 -0
- package/dist/number/refined-number-utils.d.mts.map +1 -0
- package/dist/number/refined-number-utils.mjs +179 -0
- package/dist/number/refined-number-utils.mjs.map +1 -0
- package/dist/object/index.d.mts +2 -0
- package/dist/object/index.d.mts.map +1 -0
- package/dist/object/index.mjs +2 -0
- package/dist/object/index.mjs.map +1 -0
- package/dist/object/object.d.mts +296 -0
- package/dist/object/object.d.mts.map +1 -0
- package/dist/object/object.mjs +295 -0
- package/dist/object/object.mjs.map +1 -0
- package/dist/others/cast-mutable.d.mts +110 -0
- package/dist/others/cast-mutable.d.mts.map +1 -0
- package/dist/others/cast-mutable.mjs +114 -0
- package/dist/others/cast-mutable.mjs.map +1 -0
- package/dist/others/cast-readonly.d.mts +189 -0
- package/dist/others/cast-readonly.d.mts.map +1 -0
- package/dist/others/cast-readonly.mjs +193 -0
- package/dist/others/cast-readonly.mjs.map +1 -0
- package/dist/others/if-then.d.mts +98 -0
- package/dist/others/if-then.d.mts.map +1 -0
- package/dist/others/if-then.mjs +100 -0
- package/dist/others/if-then.mjs.map +1 -0
- package/dist/others/index.d.mts +8 -0
- package/dist/others/index.d.mts.map +1 -0
- package/dist/others/index.mjs +8 -0
- package/dist/others/index.mjs.map +1 -0
- package/dist/others/map-nullable.d.mts +151 -0
- package/dist/others/map-nullable.d.mts.map +1 -0
- package/dist/others/map-nullable.mjs +159 -0
- package/dist/others/map-nullable.mjs.map +1 -0
- package/dist/others/memoize-function.d.mts +173 -0
- package/dist/others/memoize-function.d.mts.map +1 -0
- package/dist/others/memoize-function.mjs +189 -0
- package/dist/others/memoize-function.mjs.map +1 -0
- package/dist/others/tuple.d.mts +159 -0
- package/dist/others/tuple.d.mts.map +1 -0
- package/dist/others/tuple.mjs +161 -0
- package/dist/others/tuple.mjs.map +1 -0
- package/dist/others/unknown-to-string.d.mts +180 -0
- package/dist/others/unknown-to-string.d.mts.map +1 -0
- package/dist/others/unknown-to-string.mjs +211 -0
- package/dist/others/unknown-to-string.mjs.map +1 -0
- package/dist/tsconfig.json +1 -0
- package/package.json +16 -14
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import { Optional } from '../functional/optional.mjs';
|
|
2
|
+
import { pipe } from '../functional/pipe.mjs';
|
|
3
|
+
import '../functional/result.mjs';
|
|
4
|
+
import '../number/branded-types/finite-number.mjs';
|
|
5
|
+
import '../number/branded-types/int.mjs';
|
|
6
|
+
import '../number/branded-types/int16.mjs';
|
|
7
|
+
import '../number/branded-types/int32.mjs';
|
|
8
|
+
import '../number/branded-types/non-negative-finite-number.mjs';
|
|
9
|
+
import '../number/branded-types/non-negative-int16.mjs';
|
|
10
|
+
import '../number/branded-types/non-negative-int32.mjs';
|
|
11
|
+
import '../number/branded-types/non-zero-finite-number.mjs';
|
|
12
|
+
import '../number/branded-types/non-zero-int.mjs';
|
|
13
|
+
import '../number/branded-types/non-zero-int16.mjs';
|
|
14
|
+
import '../number/branded-types/non-zero-int32.mjs';
|
|
15
|
+
import '../number/branded-types/non-zero-safe-int.mjs';
|
|
16
|
+
import '../number/branded-types/non-zero-uint16.mjs';
|
|
17
|
+
import '../number/branded-types/non-zero-uint32.mjs';
|
|
18
|
+
import '../number/branded-types/positive-finite-number.mjs';
|
|
19
|
+
import '../number/branded-types/positive-int.mjs';
|
|
20
|
+
import '../number/branded-types/positive-int16.mjs';
|
|
21
|
+
import '../number/branded-types/positive-int32.mjs';
|
|
22
|
+
import '../number/branded-types/positive-safe-int.mjs';
|
|
23
|
+
import '../number/branded-types/positive-uint16.mjs';
|
|
24
|
+
import '../number/branded-types/positive-uint32.mjs';
|
|
25
|
+
import '../number/branded-types/safe-int.mjs';
|
|
26
|
+
import '../number/branded-types/safe-uint.mjs';
|
|
27
|
+
import '../number/branded-types/uint.mjs';
|
|
28
|
+
import '../number/branded-types/uint16.mjs';
|
|
29
|
+
import { asUint32 } from '../number/branded-types/uint32.mjs';
|
|
30
|
+
import '../number/enum/int8.mjs';
|
|
31
|
+
import '../number/enum/uint8.mjs';
|
|
32
|
+
import '../number/num.mjs';
|
|
33
|
+
import '../number/refined-number-utils.mjs';
|
|
34
|
+
import { tp } from '../others/tuple.mjs';
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Provides utility functions for IMapMapped.
|
|
38
|
+
*/
|
|
39
|
+
var IMapMapped;
|
|
40
|
+
(function (IMapMapped) {
|
|
41
|
+
/**
|
|
42
|
+
* Creates a new IMapMapped instance with custom key transformation functions.
|
|
43
|
+
*
|
|
44
|
+
* This factory function creates an immutable map that can use complex objects as keys
|
|
45
|
+
* by providing bidirectional transformation functions. The `toKey` function converts
|
|
46
|
+
* your custom key type to a primitive type that can be efficiently stored, while
|
|
47
|
+
* `fromKey` reconstructs the original key type for iteration and access.
|
|
48
|
+
*
|
|
49
|
+
* **Performance:** O(n) where n is the number of entries in the iterable.
|
|
50
|
+
*
|
|
51
|
+
* @template K The type of the custom keys.
|
|
52
|
+
* @template V The type of the values.
|
|
53
|
+
* @template KM The type of the mapped primitive keys.
|
|
54
|
+
* @param iterable An iterable of key-value pairs using the custom key type.
|
|
55
|
+
* @param toKey A function that converts a custom key `K` to a primitive key `KM`.
|
|
56
|
+
* This function must be deterministic and produce unique values for unique keys.
|
|
57
|
+
* @param fromKey A function that converts a primitive key `KM` back to the custom key `K`.
|
|
58
|
+
* This should be the inverse of `toKey`.
|
|
59
|
+
* @returns A new IMapMapped instance containing all entries from the iterable.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* // Example 1: Geographic coordinates as keys
|
|
64
|
+
* type Coordinate = { lat: number; lng: number };
|
|
65
|
+
* type LocationInfo = { name: string; population: number };
|
|
66
|
+
*
|
|
67
|
+
* const coordToString = (coord: Coordinate): string => `${coord.lat},${coord.lng}`;
|
|
68
|
+
* const stringToCoord = (str: string): Coordinate => {
|
|
69
|
+
* const [lat, lng] = str.split(',').map(Number);
|
|
70
|
+
* return { lat, lng };
|
|
71
|
+
* };
|
|
72
|
+
*
|
|
73
|
+
* const locationMap = IMapMapped.create<Coordinate, LocationInfo, string>(
|
|
74
|
+
* [
|
|
75
|
+
* [{ lat: 40.7128, lng: -74.0060 }, { name: "New York", population: 8000000 }],
|
|
76
|
+
* [{ lat: 34.0522, lng: -118.2437 }, { name: "Los Angeles", population: 4000000 }]
|
|
77
|
+
* ],
|
|
78
|
+
* coordToString,
|
|
79
|
+
* stringToCoord
|
|
80
|
+
* );
|
|
81
|
+
*
|
|
82
|
+
* const nyCoord = { lat: 40.7128, lng: -74.0060 };
|
|
83
|
+
* console.log(locationMap.get(nyCoord).unwrap().name); // Output: "New York"
|
|
84
|
+
*
|
|
85
|
+
* // Example 2: Multi-part business keys
|
|
86
|
+
* type OrderId = { customerId: string; year: number; orderNumber: number };
|
|
87
|
+
*
|
|
88
|
+
* const orderIdToKey = (id: OrderId): string =>
|
|
89
|
+
* `${id.customerId}:${id.year}:${id.orderNumber}`;
|
|
90
|
+
*
|
|
91
|
+
* const keyToOrderId = (key: string): OrderId => {
|
|
92
|
+
* const [customerId, yearStr, orderNumStr] = key.split(':');
|
|
93
|
+
* return {
|
|
94
|
+
* customerId,
|
|
95
|
+
* year: Number(yearStr),
|
|
96
|
+
* orderNumber: Number(orderNumStr)
|
|
97
|
+
* };
|
|
98
|
+
* };
|
|
99
|
+
*
|
|
100
|
+
* const orderMap = IMapMapped.create<OrderId, Order, string>(
|
|
101
|
+
* [],
|
|
102
|
+
* orderIdToKey,
|
|
103
|
+
* keyToOrderId
|
|
104
|
+
* );
|
|
105
|
+
*
|
|
106
|
+
* // Example 3: Simple case with string keys (identity transformation)
|
|
107
|
+
* const simpleMap = IMapMapped.create<string, number, string>(
|
|
108
|
+
* [["key1", 100], ["key2", 200]],
|
|
109
|
+
* (s) => s, // identity function
|
|
110
|
+
* (s) => s // identity function
|
|
111
|
+
* );
|
|
112
|
+
*
|
|
113
|
+
* // Example 4: From existing data structures
|
|
114
|
+
* const existingEntries = new Map([
|
|
115
|
+
* [{ id: 1, type: "user" }, { name: "Alice", active: true }],
|
|
116
|
+
* [{ id: 2, type: "user" }, { name: "Bob", active: false }]
|
|
117
|
+
* ]);
|
|
118
|
+
*
|
|
119
|
+
* type EntityKey = { id: number; type: string };
|
|
120
|
+
* const entityKeyToString = (key: EntityKey): string => `${key.type}_${key.id}`;
|
|
121
|
+
* const stringToEntityKey = (str: string): EntityKey => {
|
|
122
|
+
* const [type, idStr] = str.split('_');
|
|
123
|
+
* return { type, id: Number(idStr) };
|
|
124
|
+
* };
|
|
125
|
+
*
|
|
126
|
+
* const entityMap = IMapMapped.create<EntityKey, Entity, string>(
|
|
127
|
+
* existingEntries,
|
|
128
|
+
* entityKeyToString,
|
|
129
|
+
* stringToEntityKey
|
|
130
|
+
* );
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
IMapMapped.create = (iterable, toKey, fromKey) => new IMapMappedClass(iterable, toKey, fromKey);
|
|
134
|
+
/**
|
|
135
|
+
* Checks if two IMapMapped instances are structurally equal.
|
|
136
|
+
*
|
|
137
|
+
* Two IMapMapped instances are considered equal if they have the same size and contain
|
|
138
|
+
* exactly the same key-value pairs. The comparison is performed on the underlying mapped
|
|
139
|
+
* keys and values, so the transformation functions themselves don't need to be identical.
|
|
140
|
+
* Values are compared using JavaScript's `===` operator.
|
|
141
|
+
*
|
|
142
|
+
* **Performance:** O(n) where n is the size of the smaller map.
|
|
143
|
+
*
|
|
144
|
+
* @template K The type of the custom keys.
|
|
145
|
+
* @template V The type of the values.
|
|
146
|
+
* @template KM The type of the mapped primitive keys.
|
|
147
|
+
* @param a The first IMapMapped instance to compare.
|
|
148
|
+
* @param b The second IMapMapped instance to compare.
|
|
149
|
+
* @returns `true` if the maps contain exactly the same key-value pairs, `false` otherwise.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* // Example with coordinate keys
|
|
154
|
+
* type Point = { x: number; y: number };
|
|
155
|
+
* const pointToString = (p: Point): string => `${p.x},${p.y}`;
|
|
156
|
+
* const stringToPoint = (s: string): Point => {
|
|
157
|
+
* const [x, y] = s.split(',').map(Number);
|
|
158
|
+
* return { x, y };
|
|
159
|
+
* };
|
|
160
|
+
*
|
|
161
|
+
* const map1 = IMapMapped.create<Point, string, string>(
|
|
162
|
+
* [[{ x: 1, y: 2 }, "point1"], [{ x: 3, y: 4 }, "point2"]],
|
|
163
|
+
* pointToString,
|
|
164
|
+
* stringToPoint
|
|
165
|
+
* );
|
|
166
|
+
*
|
|
167
|
+
* const map2 = IMapMapped.create<Point, string, string>(
|
|
168
|
+
* [[{ x: 1, y: 2 }, "point1"], [{ x: 3, y: 4 }, "point2"]], // Same content
|
|
169
|
+
* pointToString,
|
|
170
|
+
* stringToPoint
|
|
171
|
+
* );
|
|
172
|
+
*
|
|
173
|
+
* const map3 = IMapMapped.create<Point, string, string>(
|
|
174
|
+
* [[{ x: 1, y: 2 }, "point1"], [{ x: 3, y: 4 }, "different"]], // Different value
|
|
175
|
+
* pointToString,
|
|
176
|
+
* stringToPoint
|
|
177
|
+
* );
|
|
178
|
+
*
|
|
179
|
+
* console.log(IMapMapped.equal(map1, map2)); // true
|
|
180
|
+
* console.log(IMapMapped.equal(map1, map3)); // false (different value)
|
|
181
|
+
*
|
|
182
|
+
* // Order doesn't matter for equality
|
|
183
|
+
* const map4 = IMapMapped.create<Point, string, string>(
|
|
184
|
+
* [[{ x: 3, y: 4 }, "point2"], [{ x: 1, y: 2 }, "point1"]], // Different order
|
|
185
|
+
* pointToString,
|
|
186
|
+
* stringToPoint
|
|
187
|
+
* );
|
|
188
|
+
*
|
|
189
|
+
* console.log(IMapMapped.equal(map1, map4)); // true
|
|
190
|
+
*
|
|
191
|
+
* // Different transformation functions but same logical content
|
|
192
|
+
* const alternativePointToString = (p: Point): string => `(${p.x},${p.y})`; // Different format
|
|
193
|
+
* const alternativeStringToPoint = (s: string): Point => {
|
|
194
|
+
* const match = s.match(/\((\d+),(\d+)\)/);
|
|
195
|
+
* return { x: Number(match![1]), y: Number(match![2]) };
|
|
196
|
+
* };
|
|
197
|
+
*
|
|
198
|
+
* const map5 = IMapMapped.create<Point, string, string>(
|
|
199
|
+
* [[{ x: 1, y: 2 }, "point1"], [{ x: 3, y: 4 }, "point2"]],
|
|
200
|
+
* alternativePointToString,
|
|
201
|
+
* alternativeStringToPoint
|
|
202
|
+
* );
|
|
203
|
+
*
|
|
204
|
+
* // This would be false because the underlying mapped keys are different
|
|
205
|
+
* // even though the logical content is the same
|
|
206
|
+
* console.log(IMapMapped.equal(map1, map5)); // false
|
|
207
|
+
*
|
|
208
|
+
* // Empty maps
|
|
209
|
+
* const empty1 = IMapMapped.create<Point, string, string>([], pointToString, stringToPoint);
|
|
210
|
+
* const empty2 = IMapMapped.create<Point, string, string>([], pointToString, stringToPoint);
|
|
211
|
+
* console.log(IMapMapped.equal(empty1, empty2)); // true
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
IMapMapped.equal = (a, b) => a.size === b.size && a.every((v, k) => b.get(k) === v);
|
|
215
|
+
})(IMapMapped || (IMapMapped = {}));
|
|
216
|
+
/**
|
|
217
|
+
* Internal class implementation for IMapMapped providing immutable map operations with key transformation.
|
|
218
|
+
*
|
|
219
|
+
* This class implements the IMapMapped interface by maintaining a JavaScript Map with primitive keys
|
|
220
|
+
* internally while exposing an API that works with custom key types. The transformation between
|
|
221
|
+
* custom and primitive keys is handled transparently through the provided `toKey` and `fromKey` functions.
|
|
222
|
+
*
|
|
223
|
+
* **Implementation Details:**
|
|
224
|
+
* - Uses ReadonlyMap<KM, V> internally where KM is the primitive key type
|
|
225
|
+
* - Stores transformation functions for bidirectional key conversion
|
|
226
|
+
* - Implements copy-on-write semantics for efficiency
|
|
227
|
+
* - Provides optional debug messaging for development
|
|
228
|
+
*
|
|
229
|
+
* @template K The type of the custom keys.
|
|
230
|
+
* @template V The type of the values.
|
|
231
|
+
* @template KM The type of the mapped primitive keys.
|
|
232
|
+
* @implements IMapMapped
|
|
233
|
+
* @implements Iterable
|
|
234
|
+
* @internal This class should not be used directly. Use IMapMapped.create() instead.
|
|
235
|
+
*/
|
|
236
|
+
class IMapMappedClass {
|
|
237
|
+
#map;
|
|
238
|
+
#toKey;
|
|
239
|
+
#fromKey;
|
|
240
|
+
#showNotFoundMessage;
|
|
241
|
+
/**
|
|
242
|
+
* Constructs an IMapMappedClass instance with custom key transformation.
|
|
243
|
+
*
|
|
244
|
+
* @param iterable An iterable of key-value pairs using the custom key type K.
|
|
245
|
+
* @param toKey A function that converts a custom key K to a primitive key KM.
|
|
246
|
+
* Must be deterministic and produce unique values for unique keys.
|
|
247
|
+
* @param fromKey A function that converts a primitive key KM back to the custom key K.
|
|
248
|
+
* Should be the inverse of the toKey function.
|
|
249
|
+
* @param showNotFoundMessage Whether to log warning messages when operations
|
|
250
|
+
* are performed on non-existent keys. Useful for debugging.
|
|
251
|
+
* Defaults to false for production use.
|
|
252
|
+
* @internal Use IMapMapped.create() instead of calling this constructor directly.
|
|
253
|
+
*/
|
|
254
|
+
constructor(iterable, toKey, fromKey, showNotFoundMessage = false) {
|
|
255
|
+
this.#map = new Map(Array.from(iterable, ([k, v]) => [toKey(k), v]));
|
|
256
|
+
this.#toKey = toKey;
|
|
257
|
+
this.#fromKey = fromKey;
|
|
258
|
+
this.#showNotFoundMessage = showNotFoundMessage;
|
|
259
|
+
}
|
|
260
|
+
/** @inheritdoc */
|
|
261
|
+
get size() {
|
|
262
|
+
return asUint32(this.#map.size);
|
|
263
|
+
}
|
|
264
|
+
/** @inheritdoc */
|
|
265
|
+
has(key) {
|
|
266
|
+
return this.#map.has(this.#toKey(key));
|
|
267
|
+
}
|
|
268
|
+
/** @inheritdoc */
|
|
269
|
+
get(key) {
|
|
270
|
+
if (!this.has(key))
|
|
271
|
+
return Optional.none;
|
|
272
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
273
|
+
return Optional.some(this.#map.get(this.#toKey(key)));
|
|
274
|
+
}
|
|
275
|
+
/** @inheritdoc */
|
|
276
|
+
every(predicate) {
|
|
277
|
+
for (const [k, v] of this.entries()) {
|
|
278
|
+
if (!predicate(v, k))
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
return true;
|
|
282
|
+
}
|
|
283
|
+
/** @inheritdoc */
|
|
284
|
+
some(predicate) {
|
|
285
|
+
for (const [k, v] of this.entries()) {
|
|
286
|
+
if (predicate(v, k))
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
/** @inheritdoc */
|
|
292
|
+
delete(key) {
|
|
293
|
+
if (!this.has(key)) {
|
|
294
|
+
if (this.#showNotFoundMessage) {
|
|
295
|
+
console.warn(`IMapMapped.delete: key not found: ${String(this.#toKey(key))}`);
|
|
296
|
+
}
|
|
297
|
+
return this;
|
|
298
|
+
}
|
|
299
|
+
const keyMapped = this.#toKey(key);
|
|
300
|
+
return IMapMapped.create(Array.from(this.#map)
|
|
301
|
+
.filter(([km]) => !Object.is(km, keyMapped))
|
|
302
|
+
.map(([km, v]) => tp(this.#fromKey(km), v)), this.#toKey, this.#fromKey);
|
|
303
|
+
}
|
|
304
|
+
/** @inheritdoc */
|
|
305
|
+
set(key, value) {
|
|
306
|
+
if (value === this.get(key))
|
|
307
|
+
return this; // has no changes
|
|
308
|
+
const keyMapped = this.#toKey(key);
|
|
309
|
+
if (!this.has(key)) {
|
|
310
|
+
return IMapMapped.create([...this.#map, tp(keyMapped, value)].map(([km, v]) => tp(this.#fromKey(km), v)), this.#toKey, this.#fromKey);
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
return IMapMapped.create(Array.from(this.#map, ([km, v]) => tp(this.#fromKey(km), Object.is(km, keyMapped) ? value : v)), this.#toKey, this.#fromKey);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/** @inheritdoc */
|
|
317
|
+
update(key, updater) {
|
|
318
|
+
const curr = this.get(key);
|
|
319
|
+
if (Optional.isNone(curr)) {
|
|
320
|
+
if (this.#showNotFoundMessage) {
|
|
321
|
+
console.warn(`IMapMapped.update: key not found: ${String(this.#toKey(key))}`);
|
|
322
|
+
}
|
|
323
|
+
return this;
|
|
324
|
+
}
|
|
325
|
+
const keyMapped = this.#toKey(key);
|
|
326
|
+
return IMapMapped.create(Array.from(this.#map.entries(), (keyValue) => pipe(keyValue)
|
|
327
|
+
.map(([km, v]) => tp(km, Object.is(km, keyMapped) ? updater(curr.value) : v))
|
|
328
|
+
.map(([km, v]) => tp(this.#fromKey(km), v)).value), this.#toKey, this.#fromKey);
|
|
329
|
+
}
|
|
330
|
+
/** @inheritdoc */
|
|
331
|
+
withMutations(actions) {
|
|
332
|
+
const mut_result = new Map(this.#map);
|
|
333
|
+
for (const action of actions) {
|
|
334
|
+
const key = this.#toKey(action.key);
|
|
335
|
+
switch (action.type) {
|
|
336
|
+
case 'delete':
|
|
337
|
+
mut_result.delete(key);
|
|
338
|
+
break;
|
|
339
|
+
case 'set':
|
|
340
|
+
mut_result.set(key, action.value);
|
|
341
|
+
break;
|
|
342
|
+
case 'update': {
|
|
343
|
+
const curr = mut_result.get(key);
|
|
344
|
+
if (!mut_result.has(key) || curr === undefined) {
|
|
345
|
+
if (this.#showNotFoundMessage) {
|
|
346
|
+
console.warn(`IMapMapped.withMutations::update: key not found: ${String(key)}`);
|
|
347
|
+
}
|
|
348
|
+
break;
|
|
349
|
+
}
|
|
350
|
+
mut_result.set(key, action.updater(curr));
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return IMapMapped.create(Array.from(mut_result, ([k, v]) => [this.#fromKey(k), v]), this.#toKey, this.#fromKey);
|
|
356
|
+
}
|
|
357
|
+
/** @inheritdoc */
|
|
358
|
+
map(mapFn) {
|
|
359
|
+
return IMapMapped.create(this.toArray().map(([k, v]) => tp(k, mapFn(v, k))), this.#toKey, this.#fromKey);
|
|
360
|
+
}
|
|
361
|
+
/** @inheritdoc */
|
|
362
|
+
mapKeys(mapFn) {
|
|
363
|
+
return IMapMapped.create(this.toArray().map(([k, v]) => tp(mapFn(k), v)), this.#toKey, this.#fromKey);
|
|
364
|
+
}
|
|
365
|
+
/** @inheritdoc */
|
|
366
|
+
mapEntries(mapFn) {
|
|
367
|
+
return IMapMapped.create(this.toArray().map(mapFn), this.#toKey, this.#fromKey);
|
|
368
|
+
}
|
|
369
|
+
/** @inheritdoc */
|
|
370
|
+
forEach(callbackfn) {
|
|
371
|
+
for (const [km, value] of this.#map.entries()) {
|
|
372
|
+
callbackfn(value, this.#fromKey(km));
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* @inheritdoc
|
|
377
|
+
*/
|
|
378
|
+
*[Symbol.iterator]() {
|
|
379
|
+
for (const e of this.entries()) {
|
|
380
|
+
yield e;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/** @inheritdoc */
|
|
384
|
+
*keys() {
|
|
385
|
+
for (const km of this.#map.keys()) {
|
|
386
|
+
yield this.#fromKey(km);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
/** @inheritdoc */
|
|
390
|
+
*values() {
|
|
391
|
+
for (const v of this.#map.values()) {
|
|
392
|
+
yield v;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
/** @inheritdoc */
|
|
396
|
+
*entries() {
|
|
397
|
+
for (const [km, v] of this.#map.entries()) {
|
|
398
|
+
yield [this.#fromKey(km), v];
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
/** @inheritdoc */
|
|
402
|
+
toKeysArray() {
|
|
403
|
+
return Array.from(this.keys());
|
|
404
|
+
}
|
|
405
|
+
/** @inheritdoc */
|
|
406
|
+
toValuesArray() {
|
|
407
|
+
return Array.from(this.values());
|
|
408
|
+
}
|
|
409
|
+
/** @inheritdoc */
|
|
410
|
+
toEntriesArray() {
|
|
411
|
+
return Array.from(this.entries());
|
|
412
|
+
}
|
|
413
|
+
/** @inheritdoc */
|
|
414
|
+
toArray() {
|
|
415
|
+
return Array.from(this.entries());
|
|
416
|
+
}
|
|
417
|
+
/** @inheritdoc */
|
|
418
|
+
toRawMap() {
|
|
419
|
+
return this.#map;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export { IMapMapped };
|
|
424
|
+
//# sourceMappingURL=imap-mapped.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imap-mapped.mjs","sources":["../../src/collections/imap-mapped.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgTA;;AAEG;AACG,IAAW;AAAjB,CAAA,UAAiB,UAAU,EAAA;AACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FG;AACU,IAAA,UAAA,CAAA,MAAM,GAAG,CACpB,QAAmC,EACnC,KAAmB,EACnB,OAAqB,KAErB,IAAI,eAAe,CAAW,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EG;AACU,IAAA,UA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