ts-data-forge 3.3.0 → 3.3.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 +37 -13
- package/dist/array/impl/array-utils-creation.d.mts +116 -0
- package/dist/array/impl/array-utils-creation.d.mts.map +1 -0
- package/dist/array/impl/array-utils-creation.mjs +110 -0
- package/dist/array/impl/array-utils-creation.mjs.map +1 -0
- package/dist/array/impl/array-utils-element-access.d.mts +61 -0
- package/dist/array/impl/array-utils-element-access.d.mts.map +1 -0
- package/dist/array/impl/array-utils-element-access.mjs +66 -0
- package/dist/array/impl/array-utils-element-access.mjs.map +1 -0
- package/dist/array/impl/array-utils-iterators.d.mts +59 -0
- package/dist/array/impl/array-utils-iterators.d.mts.map +1 -0
- package/dist/array/impl/array-utils-iterators.mjs +104 -0
- package/dist/array/impl/array-utils-iterators.mjs.map +1 -0
- package/dist/array/impl/array-utils-modification.d.mts +154 -0
- package/dist/array/impl/array-utils-modification.d.mts.map +1 -0
- package/dist/array/impl/array-utils-modification.mjs +139 -0
- package/dist/array/impl/array-utils-modification.mjs.map +1 -0
- package/dist/array/impl/array-utils-reducing-value.d.mts +214 -0
- package/dist/array/impl/array-utils-reducing-value.d.mts.map +1 -0
- package/dist/array/impl/array-utils-reducing-value.mjs +160 -0
- package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -0
- package/dist/array/impl/array-utils-search.d.mts +179 -0
- package/dist/array/impl/array-utils-search.d.mts.map +1 -0
- package/dist/array/impl/array-utils-search.mjs +153 -0
- package/dist/array/impl/array-utils-search.mjs.map +1 -0
- package/dist/array/impl/array-utils-set-op.d.mts +100 -0
- package/dist/array/impl/array-utils-set-op.d.mts.map +1 -0
- package/dist/array/impl/array-utils-set-op.mjs +137 -0
- package/dist/array/impl/array-utils-set-op.mjs.map +1 -0
- package/dist/array/impl/array-utils-size.d.mts +24 -0
- package/dist/array/impl/array-utils-size.d.mts.map +1 -0
- package/dist/array/impl/array-utils-size.mjs +28 -0
- package/dist/array/impl/array-utils-size.mjs.map +1 -0
- package/dist/array/impl/array-utils-slice-clamped.d.mts +18 -0
- package/dist/array/impl/array-utils-slice-clamped.d.mts.map +1 -0
- package/dist/array/impl/array-utils-slice-clamped.mjs +49 -0
- package/dist/array/impl/array-utils-slice-clamped.mjs.map +1 -0
- package/dist/array/impl/array-utils-slicing.d.mts +120 -0
- package/dist/array/impl/array-utils-slicing.d.mts.map +1 -0
- package/dist/array/impl/array-utils-slicing.mjs +140 -0
- package/dist/array/impl/array-utils-slicing.mjs.map +1 -0
- package/dist/array/impl/array-utils-transformation.d.mts +348 -0
- package/dist/array/impl/array-utils-transformation.d.mts.map +1 -0
- package/dist/array/impl/array-utils-transformation.mjs +331 -0
- package/dist/array/impl/array-utils-transformation.mjs.map +1 -0
- package/dist/array/impl/array-utils-validation.d.mts +149 -0
- package/dist/array/impl/array-utils-validation.d.mts.map +1 -0
- package/dist/array/impl/array-utils-validation.mjs +166 -0
- package/dist/array/impl/array-utils-validation.mjs.map +1 -0
- package/dist/array/impl/index.d.mts +13 -0
- package/dist/array/impl/index.d.mts.map +1 -0
- package/dist/array/impl/index.mjs +13 -0
- package/dist/array/impl/index.mjs.map +1 -0
- package/dist/array/index.d.mts +1 -1
- package/dist/array/index.d.mts.map +1 -1
- package/dist/array/index.mjs +2 -1
- package/dist/array/index.mjs.map +1 -1
- package/dist/collections/imap-mapped.d.mts +83 -253
- package/dist/collections/imap-mapped.d.mts.map +1 -1
- package/dist/collections/imap-mapped.mjs +33 -164
- package/dist/collections/imap-mapped.mjs.map +1 -1
- package/dist/collections/imap.d.mts +436 -163
- package/dist/collections/imap.d.mts.map +1 -1
- package/dist/collections/imap.mjs +74 -94
- package/dist/collections/imap.mjs.map +1 -1
- package/dist/collections/iset-mapped.d.mts +828 -345
- package/dist/collections/iset-mapped.d.mts.map +1 -1
- package/dist/collections/iset-mapped.mjs +200 -242
- package/dist/collections/iset-mapped.mjs.map +1 -1
- package/dist/collections/iset.d.mts +397 -205
- package/dist/collections/iset.d.mts.map +1 -1
- package/dist/collections/iset.mjs +102 -184
- package/dist/collections/iset.mjs.map +1 -1
- package/dist/collections/queue.d.mts +155 -135
- package/dist/collections/queue.d.mts.map +1 -1
- package/dist/collections/queue.mjs +55 -156
- package/dist/collections/queue.mjs.map +1 -1
- package/dist/collections/stack.d.mts +154 -154
- package/dist/collections/stack.d.mts.map +1 -1
- package/dist/collections/stack.mjs +54 -203
- package/dist/collections/stack.mjs.map +1 -1
- package/dist/entry-point.d.mts +1 -0
- package/dist/entry-point.d.mts.map +1 -1
- package/dist/entry-point.mjs +2 -1
- package/dist/entry-point.mjs.map +1 -1
- package/dist/expect-type.d.mts +43 -172
- package/dist/expect-type.d.mts.map +1 -1
- package/dist/expect-type.mjs +43 -172
- package/dist/expect-type.mjs.map +1 -1
- package/dist/functional/match.d.mts +35 -140
- package/dist/functional/match.d.mts.map +1 -1
- package/dist/functional/match.mjs.map +1 -1
- package/dist/functional/optional.d.mts +282 -160
- package/dist/functional/optional.d.mts.map +1 -1
- package/dist/functional/optional.mjs +131 -71
- package/dist/functional/optional.mjs.map +1 -1
- package/dist/functional/pipe.d.mts +59 -113
- package/dist/functional/pipe.d.mts.map +1 -1
- package/dist/functional/pipe.mjs.map +1 -1
- package/dist/functional/result.d.mts +433 -332
- package/dist/functional/result.d.mts.map +1 -1
- package/dist/functional/result.mjs +233 -239
- package/dist/functional/result.mjs.map +1 -1
- package/dist/globals.d.mts +12 -5
- package/dist/guard/has-key.d.mts +23 -74
- package/dist/guard/has-key.d.mts.map +1 -1
- package/dist/guard/has-key.mjs +23 -74
- package/dist/guard/has-key.mjs.map +1 -1
- package/dist/guard/is-non-empty-string.d.mts +20 -87
- package/dist/guard/is-non-empty-string.d.mts.map +1 -1
- package/dist/guard/is-non-empty-string.mjs +20 -87
- package/dist/guard/is-non-empty-string.mjs.map +1 -1
- package/dist/guard/is-non-null-object.d.mts +14 -84
- package/dist/guard/is-non-null-object.d.mts.map +1 -1
- package/dist/guard/is-non-null-object.mjs +14 -84
- package/dist/guard/is-non-null-object.mjs.map +1 -1
- package/dist/guard/is-primitive.d.mts +13 -126
- package/dist/guard/is-primitive.d.mts.map +1 -1
- package/dist/guard/is-primitive.mjs +13 -126
- package/dist/guard/is-primitive.mjs.map +1 -1
- package/dist/guard/is-record.d.mts +21 -132
- package/dist/guard/is-record.d.mts.map +1 -1
- package/dist/guard/is-record.mjs +21 -132
- package/dist/guard/is-record.mjs.map +1 -1
- package/dist/guard/is-type.d.mts +201 -238
- package/dist/guard/is-type.d.mts.map +1 -1
- package/dist/guard/is-type.mjs +201 -238
- package/dist/guard/is-type.mjs.map +1 -1
- package/dist/guard/key-is-in.d.mts +22 -139
- package/dist/guard/key-is-in.d.mts.map +1 -1
- package/dist/guard/key-is-in.mjs +22 -139
- package/dist/guard/key-is-in.mjs.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +1 -1
- package/dist/iterator/range.d.mts +29 -62
- package/dist/iterator/range.d.mts.map +1 -1
- package/dist/iterator/range.mjs.map +1 -1
- package/dist/json/json.d.mts +191 -121
- package/dist/json/json.d.mts.map +1 -1
- package/dist/json/json.mjs +238 -136
- package/dist/json/json.mjs.map +1 -1
- package/dist/number/branded-types/finite-number.d.mts +24 -156
- package/dist/number/branded-types/finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/finite-number.mjs +27 -159
- package/dist/number/branded-types/finite-number.mjs.map +1 -1
- package/dist/number/branded-types/int.d.mts +122 -120
- package/dist/number/branded-types/int.d.mts.map +1 -1
- package/dist/number/branded-types/int.mjs +122 -120
- package/dist/number/branded-types/int.mjs.map +1 -1
- package/dist/number/branded-types/int16.d.mts +22 -30
- package/dist/number/branded-types/int16.d.mts.map +1 -1
- package/dist/number/branded-types/int16.mjs +22 -30
- package/dist/number/branded-types/int16.mjs.map +1 -1
- package/dist/number/branded-types/int32.d.mts +22 -31
- package/dist/number/branded-types/int32.d.mts.map +1 -1
- package/dist/number/branded-types/int32.mjs +22 -31
- package/dist/number/branded-types/int32.mjs.map +1 -1
- package/dist/number/branded-types/non-negative-finite-number.d.mts +28 -36
- package/dist/number/branded-types/non-negative-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/non-negative-finite-number.mjs +31 -39
- package/dist/number/branded-types/non-negative-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/non-negative-int16.d.mts +24 -34
- package/dist/number/branded-types/non-negative-int16.d.mts.map +1 -1
- package/dist/number/branded-types/non-negative-int16.mjs +24 -34
- package/dist/number/branded-types/non-negative-int16.mjs.map +1 -1
- package/dist/number/branded-types/non-negative-int32.d.mts +26 -35
- package/dist/number/branded-types/non-negative-int32.d.mts.map +1 -1
- package/dist/number/branded-types/non-negative-int32.mjs +26 -35
- package/dist/number/branded-types/non-negative-int32.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-finite-number.d.mts +22 -37
- package/dist/number/branded-types/non-zero-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-finite-number.mjs +25 -40
- package/dist/number/branded-types/non-zero-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-int.d.mts +15 -30
- package/dist/number/branded-types/non-zero-int.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-int.mjs +15 -30
- package/dist/number/branded-types/non-zero-int.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-int16.d.mts +27 -35
- package/dist/number/branded-types/non-zero-int16.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-int16.mjs +27 -35
- package/dist/number/branded-types/non-zero-int16.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-int32.d.mts +29 -36
- package/dist/number/branded-types/non-zero-int32.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-int32.mjs +29 -36
- package/dist/number/branded-types/non-zero-int32.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-safe-int.d.mts +37 -38
- package/dist/number/branded-types/non-zero-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-safe-int.mjs +39 -40
- package/dist/number/branded-types/non-zero-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-uint16.d.mts +24 -35
- package/dist/number/branded-types/non-zero-uint16.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-uint16.mjs +24 -35
- package/dist/number/branded-types/non-zero-uint16.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-uint32.d.mts +24 -35
- package/dist/number/branded-types/non-zero-uint32.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-uint32.mjs +24 -35
- package/dist/number/branded-types/non-zero-uint32.mjs.map +1 -1
- package/dist/number/branded-types/positive-finite-number.d.mts +26 -40
- package/dist/number/branded-types/positive-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/positive-finite-number.mjs +29 -43
- package/dist/number/branded-types/positive-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/positive-int.d.mts +133 -123
- package/dist/number/branded-types/positive-int.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int.mjs +133 -123
- package/dist/number/branded-types/positive-int.mjs.map +1 -1
- package/dist/number/branded-types/positive-int16.d.mts +24 -35
- package/dist/number/branded-types/positive-int16.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int16.mjs +24 -35
- package/dist/number/branded-types/positive-int16.mjs.map +1 -1
- package/dist/number/branded-types/positive-int32.d.mts +24 -35
- package/dist/number/branded-types/positive-int32.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int32.mjs +24 -35
- package/dist/number/branded-types/positive-int32.mjs.map +1 -1
- package/dist/number/branded-types/positive-safe-int.d.mts +159 -33
- package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/positive-safe-int.mjs +160 -34
- package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/positive-uint16.d.mts +24 -35
- package/dist/number/branded-types/positive-uint16.d.mts.map +1 -1
- package/dist/number/branded-types/positive-uint16.mjs +24 -35
- package/dist/number/branded-types/positive-uint16.mjs.map +1 -1
- package/dist/number/branded-types/positive-uint32.d.mts +26 -36
- package/dist/number/branded-types/positive-uint32.d.mts.map +1 -1
- package/dist/number/branded-types/positive-uint32.mjs +26 -36
- package/dist/number/branded-types/positive-uint32.mjs.map +1 -1
- package/dist/number/branded-types/safe-int.d.mts +140 -99
- package/dist/number/branded-types/safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/safe-int.mjs +142 -101
- package/dist/number/branded-types/safe-int.mjs.map +1 -1
- package/dist/number/branded-types/safe-uint.d.mts +24 -33
- package/dist/number/branded-types/safe-uint.d.mts.map +1 -1
- package/dist/number/branded-types/safe-uint.mjs +25 -34
- package/dist/number/branded-types/safe-uint.mjs.map +1 -1
- package/dist/number/branded-types/uint.d.mts +121 -30
- package/dist/number/branded-types/uint.d.mts.map +1 -1
- package/dist/number/branded-types/uint.mjs +121 -30
- package/dist/number/branded-types/uint.mjs.map +1 -1
- package/dist/number/branded-types/uint16.d.mts +26 -34
- package/dist/number/branded-types/uint16.d.mts.map +1 -1
- package/dist/number/branded-types/uint16.mjs +26 -34
- package/dist/number/branded-types/uint16.mjs.map +1 -1
- package/dist/number/branded-types/uint32.d.mts +26 -68
- package/dist/number/branded-types/uint32.d.mts.map +1 -1
- package/dist/number/branded-types/uint32.mjs +26 -68
- package/dist/number/branded-types/uint32.mjs.map +1 -1
- package/dist/number/enum/int8.d.mts +37 -101
- package/dist/number/enum/int8.d.mts.map +1 -1
- package/dist/number/enum/int8.mjs +39 -170
- package/dist/number/enum/int8.mjs.map +1 -1
- package/dist/number/enum/uint8.d.mts +45 -55
- package/dist/number/enum/uint8.d.mts.map +1 -1
- package/dist/number/enum/uint8.mjs +46 -155
- package/dist/number/enum/uint8.mjs.map +1 -1
- package/dist/number/num.d.mts +145 -206
- package/dist/number/num.d.mts.map +1 -1
- package/dist/number/num.mjs +143 -199
- package/dist/number/num.mjs.map +1 -1
- package/dist/number/refined-number-utils.d.mts +97 -21
- package/dist/number/refined-number-utils.d.mts.map +1 -1
- package/dist/number/refined-number-utils.mjs +91 -20
- package/dist/number/refined-number-utils.mjs.map +1 -1
- package/dist/object/object.d.mts +126 -208
- package/dist/object/object.d.mts.map +1 -1
- package/dist/object/object.mjs +68 -102
- package/dist/object/object.mjs.map +1 -1
- package/dist/others/cast-mutable.d.mts +12 -88
- package/dist/others/cast-mutable.d.mts.map +1 -1
- package/dist/others/cast-mutable.mjs +13 -89
- package/dist/others/cast-mutable.mjs.map +1 -1
- package/dist/others/cast-readonly.d.mts +12 -168
- package/dist/others/cast-readonly.d.mts.map +1 -1
- package/dist/others/cast-readonly.mjs +13 -169
- package/dist/others/cast-readonly.mjs.map +1 -1
- package/dist/others/if-then.d.mts +6 -83
- package/dist/others/if-then.d.mts.map +1 -1
- package/dist/others/if-then.mjs +6 -83
- package/dist/others/if-then.mjs.map +1 -1
- package/dist/others/map-nullable.d.mts +12 -136
- package/dist/others/map-nullable.d.mts.map +1 -1
- package/dist/others/map-nullable.mjs.map +1 -1
- package/dist/others/memoize-function.d.mts +14 -157
- package/dist/others/memoize-function.d.mts.map +1 -1
- package/dist/others/memoize-function.mjs +14 -157
- package/dist/others/memoize-function.mjs.map +1 -1
- package/dist/others/tuple.d.mts +33 -151
- package/dist/others/tuple.d.mts.map +1 -1
- package/dist/others/tuple.mjs +33 -151
- package/dist/others/tuple.mjs.map +1 -1
- package/dist/others/unknown-to-string.d.mts +11 -125
- package/dist/others/unknown-to-string.d.mts.map +1 -1
- package/dist/others/unknown-to-string.mjs +12 -126
- package/dist/others/unknown-to-string.mjs.map +1 -1
- package/dist/promise/promise.d.mts +33 -20
- package/dist/promise/promise.d.mts.map +1 -1
- package/dist/promise/promise.mjs +34 -21
- package/dist/promise/promise.mjs.map +1 -1
- package/package.json +47 -39
- package/src/array/impl/array-utils-creation.mts +192 -0
- package/src/array/{array-utils-creation.test.mts → impl/array-utils-creation.test.mts} +121 -72
- package/src/array/impl/array-utils-element-access.mts +115 -0
- package/src/array/impl/array-utils-element-access.test.mts +151 -0
- package/src/array/impl/array-utils-iterators.mts +79 -0
- package/src/array/impl/array-utils-iterators.test.mts +98 -0
- package/src/array/impl/array-utils-modification.mts +434 -0
- package/src/array/{array-utils-modification.test.mts → impl/array-utils-modification.test.mts} +41 -28
- package/src/array/{array-utils-overload-type-error.test.mts → impl/array-utils-overload-type-error.test.mts} +33 -33
- package/src/array/impl/array-utils-reducing-value.mts +551 -0
- package/src/array/{array-utils-reducing-value.test.mts → impl/array-utils-reducing-value.test.mts} +45 -50
- package/src/array/impl/array-utils-search.mts +509 -0
- package/src/array/impl/array-utils-search.test.mts +346 -0
- package/src/array/impl/array-utils-set-op.mts +166 -0
- package/src/array/{array-utils-set-op.test.mts → impl/array-utils-set-op.test.mts} +42 -35
- package/src/array/impl/array-utils-size.mts +30 -0
- package/src/array/impl/array-utils-size.test.mts +9 -0
- package/src/array/impl/array-utils-slice-clamped.mts +51 -0
- package/src/array/{array-utils-slice-clamped.test.mts → impl/array-utils-slice-clamped.test.mts} +12 -12
- package/src/array/impl/array-utils-slicing.mts +275 -0
- package/src/array/impl/array-utils-slicing.test.mts +158 -0
- package/src/array/impl/array-utils-transformation.mts +746 -0
- package/src/array/{array-utils-transformation.test.mts → impl/array-utils-transformation.test.mts} +662 -889
- package/src/array/impl/array-utils-validation.mts +241 -0
- package/src/array/{array-utils-validation.test.mts → impl/array-utils-validation.test.mts} +194 -107
- package/src/array/{array.test.mts → impl/array.test.mts} +2 -2
- package/src/array/impl/index.mts +12 -0
- package/src/array/index.mts +1 -1
- package/src/collections/imap-mapped.mts +99 -265
- package/src/collections/imap.mts +477 -174
- package/src/collections/imap.test.mts +12 -19
- package/src/collections/iset-mapped.mts +892 -358
- package/src/collections/iset.mts +429 -213
- package/src/collections/queue.mts +174 -200
- package/src/collections/stack.mts +172 -245
- package/src/collections/stack.test.mts +9 -1
- package/src/entry-point.mts +1 -0
- package/src/expect-type.mts +43 -172
- package/src/functional/match.mts +35 -145
- package/src/functional/optional.mts +285 -163
- package/src/functional/optional.test.mts +4 -1
- package/src/functional/pipe.mts +60 -113
- package/src/functional/result.mts +452 -351
- package/src/functional/result.test.mts +9 -2
- package/src/globals.d.mts +12 -5
- package/src/guard/has-key.mts +23 -74
- package/src/guard/is-non-empty-string.mts +20 -87
- package/src/guard/is-non-null-object.mts +14 -84
- package/src/guard/is-non-null-object.test.mts +1 -1
- package/src/guard/is-primitive.mts +13 -126
- package/src/guard/is-primitive.test.mts +1 -1
- package/src/guard/is-record.mts +21 -132
- package/src/guard/is-type.mts +201 -238
- package/src/guard/is-type.test.mts +7 -7
- package/src/guard/key-is-in.mts +22 -139
- package/src/index.mts +0 -1
- package/src/iterator/range.mts +29 -62
- package/src/json/json.mts +202 -134
- package/src/json/json.test.mts +1 -3
- package/src/number/branded-types/finite-number.mts +27 -159
- package/src/number/branded-types/int.mts +122 -120
- package/src/number/branded-types/int16.mts +22 -30
- package/src/number/branded-types/int16.test.mts +24 -24
- package/src/number/branded-types/int32.mts +22 -31
- package/src/number/branded-types/int32.test.mts +39 -39
- package/src/number/branded-types/non-negative-finite-number.mts +31 -39
- package/src/number/branded-types/non-negative-int16.mts +24 -34
- package/src/number/branded-types/non-negative-int16.test.mts +16 -16
- package/src/number/branded-types/non-negative-int32.mts +26 -35
- package/src/number/branded-types/non-negative-int32.test.mts +30 -30
- package/src/number/branded-types/non-zero-finite-number.mts +25 -40
- package/src/number/branded-types/non-zero-int.mts +15 -30
- package/src/number/branded-types/non-zero-int16.mts +27 -35
- package/src/number/branded-types/non-zero-int16.test.mts +26 -26
- package/src/number/branded-types/non-zero-int32.mts +29 -36
- package/src/number/branded-types/non-zero-int32.test.mts +45 -42
- package/src/number/branded-types/non-zero-safe-int.mts +39 -40
- package/src/number/branded-types/non-zero-uint16.mts +24 -35
- package/src/number/branded-types/non-zero-uint16.test.mts +16 -16
- package/src/number/branded-types/non-zero-uint32.mts +24 -35
- package/src/number/branded-types/non-zero-uint32.test.mts +28 -28
- package/src/number/branded-types/positive-finite-number.mts +29 -43
- package/src/number/branded-types/positive-int.mts +134 -124
- package/src/number/branded-types/positive-int16.mts +24 -35
- package/src/number/branded-types/positive-int16.test.mts +14 -14
- package/src/number/branded-types/positive-int32.mts +24 -35
- package/src/number/branded-types/positive-int32.test.mts +26 -26
- package/src/number/branded-types/positive-safe-int.mts +160 -34
- package/src/number/branded-types/positive-uint16.mts +24 -35
- package/src/number/branded-types/positive-uint16.test.mts +16 -16
- package/src/number/branded-types/positive-uint32.mts +26 -36
- package/src/number/branded-types/positive-uint32.test.mts +31 -28
- package/src/number/branded-types/safe-int.mts +142 -101
- package/src/number/branded-types/safe-uint.mts +25 -34
- package/src/number/branded-types/uint.mts +121 -30
- package/src/number/branded-types/uint16.mts +26 -34
- package/src/number/branded-types/uint16.test.mts +16 -16
- package/src/number/branded-types/uint32.mts +26 -68
- package/src/number/branded-types/uint32.test.mts +28 -28
- package/src/number/enum/int8.mts +39 -170
- package/src/number/enum/uint8.mts +46 -155
- package/src/number/num.mts +157 -212
- package/src/number/num.test.mts +4 -4
- package/src/number/refined-number-utils.mts +109 -26
- package/src/object/object.mts +130 -212
- package/src/object/object.test.mts +29 -0
- package/src/others/cast-mutable.mts +13 -89
- package/src/others/cast-mutable.test.mts +80 -0
- package/src/others/cast-readonly.mts +13 -169
- package/src/others/if-then.mts +6 -83
- package/src/others/map-nullable.mts +12 -136
- package/src/others/map-nullable.test.mts +6 -6
- package/src/others/memoize-function.mts +14 -157
- package/src/others/tuple.mts +33 -151
- package/src/others/unknown-to-string.mts +12 -126
- package/src/others/unknown-to-string.test.mts +13 -1
- package/src/promise/promise.mts +34 -21
- package/src/promise/promise.test.mts +43 -0
- package/dist/array/array-utils.d.mts +0 -2956
- package/dist/array/array-utils.d.mts.map +0 -1
- package/dist/array/array-utils.mjs +0 -1838
- package/dist/array/array-utils.mjs.map +0 -1
- package/src/array/array-utils-search.test.mts +0 -169
- package/src/array/array-utils-slicing.test.mts +0 -274
- package/src/array/array-utils.mts +0 -4834
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iset-mapped.d.mts","sourceRoot":"","sources":["../../src/collections/iset-mapped.mts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"iset-mapped.d.mts","sourceRoot":"","sources":["../../src/collections/iset-mapped.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,KAAK,mBAAmB,CAAC,CAAC,EAAE,EAAE,SAAS,aAAa,IAAI,QAAQ,CAAC;IAC/D;;;;;;;OAOG;IACH,KAAK,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;IAI9E;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC;IAEnB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;IAIzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,KAAK,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,KAAK,OAAO,CAAC;IAClD;;;;;;;;OAQG;IACH,CAAC,CAAC,CAAC,SAAS,CAAC,EACX,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC,KAC5B,IAAI,IAAI,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,IAAI,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,EAA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CAAC,OAAO,GAAG,SAAS,EAAE,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAGtD,CAAC;IAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACI,MAAM,YAAY,GAAI,CAAC,EAAE,EAAE,SAAS,aAAa,EACtD,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,EACpB,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,KACnB,UAAU,CAAC,CAAC,EAAE,EAAE,CAAmB,CAAC;IAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACI,MAAM,KAAK,GAAI,CAAC,EAAE,EAAE,SAAS,aAAa,EAC/C,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,EACpB,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,KACnB,UAAU,CAAC,CAAC,EAAE,EAAE,CAAe,CAAC;CACpC"}
|
|
@@ -29,246 +29,155 @@ import '../number/enum/uint8.mjs';
|
|
|
29
29
|
import '../number/num.mjs';
|
|
30
30
|
import '../number/refined-number-utils.mjs';
|
|
31
31
|
|
|
32
|
-
/**
|
|
33
|
-
* Provides utility functions for ISetMapped.
|
|
34
|
-
*/
|
|
32
|
+
/** Provides utility functions for ISetMapped. */
|
|
35
33
|
var ISetMapped;
|
|
36
34
|
(function (ISetMapped) {
|
|
37
35
|
/**
|
|
38
|
-
* Creates a new ISetMapped instance with custom element transformation
|
|
36
|
+
* Creates a new ISetMapped instance with custom element transformation
|
|
37
|
+
* functions.
|
|
39
38
|
*
|
|
40
|
-
* This factory function creates an immutable set that can use complex objects
|
|
41
|
-
* by providing bidirectional transformation functions. The
|
|
42
|
-
* your custom element type to a primitive type that
|
|
43
|
-
* `fromKey` reconstructs the original
|
|
39
|
+
* This factory function creates an immutable set that can use complex objects
|
|
40
|
+
* as elements by providing bidirectional transformation functions. The
|
|
41
|
+
* `toKey` function converts your custom element type to a primitive type that
|
|
42
|
+
* can be efficiently stored, while `fromKey` reconstructs the original
|
|
43
|
+
* element type for iteration and access.
|
|
44
44
|
*
|
|
45
45
|
* **Performance:** O(n) where n is the number of elements in the iterable.
|
|
46
46
|
*
|
|
47
|
-
* @template K The type of the custom elements.
|
|
48
|
-
* @template KM The type of the mapped primitive keys.
|
|
49
|
-
* @param iterable An iterable of elements using the custom element type.
|
|
50
|
-
* @param toKey A function that converts a custom element `K` to a primitive key `KM`.
|
|
51
|
-
* This function must be deterministic and produce unique values for unique elements.
|
|
52
|
-
* @param fromKey A function that converts a primitive key `KM` back to the custom element `K`.
|
|
53
|
-
* This should be the inverse of `toKey`.
|
|
54
|
-
* @returns A new ISetMapped instance containing all unique elements from the iterable.
|
|
55
|
-
*
|
|
56
47
|
* @example
|
|
57
|
-
* ```typescript
|
|
58
|
-
* // Example 1: Product catalog with SKU-based identity
|
|
59
|
-
* type Product = { sku: string; name: string; price: number; category: string };
|
|
60
|
-
*
|
|
61
|
-
* const productToKey = (product: Product): string => product.sku;
|
|
62
|
-
* const keyToProduct = (sku: string): Product => {
|
|
63
|
-
* // In practice, this might fetch from a product service or cache
|
|
64
|
-
* return {
|
|
65
|
-
* sku,
|
|
66
|
-
* name: `Product ${sku}`,
|
|
67
|
-
* price: 0,
|
|
68
|
-
* category: "unknown"
|
|
69
|
-
* };
|
|
70
|
-
* };
|
|
71
|
-
*
|
|
72
|
-
* const productSet = ISetMapped.create<Product, string>(
|
|
73
|
-
* [
|
|
74
|
-
* { sku: "LAPTOP-001", name: "Gaming Laptop", price: 1299, category: "electronics" },
|
|
75
|
-
* { sku: "MOUSE-002", name: "Wireless Mouse", price: 49, category: "accessories" },
|
|
76
|
-
* { sku: "LAPTOP-001", name: "Gaming Laptop", price: 1299, category: "electronics" } // Duplicate SKU
|
|
77
|
-
* ],
|
|
78
|
-
* productToKey,
|
|
79
|
-
* keyToProduct
|
|
80
|
-
* );
|
|
81
48
|
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
49
|
+
* ```ts
|
|
50
|
+
* type Point = Readonly<{ x: number; tag: string }>;
|
|
84
51
|
*
|
|
85
|
-
*
|
|
86
|
-
* type Location = { name: string; lat: number; lng: number; type: string };
|
|
52
|
+
* const toKey = (point: Point) => JSON.stringify(point);
|
|
87
53
|
*
|
|
88
|
-
*
|
|
89
|
-
* const
|
|
90
|
-
* const [latStr, lngStr] = key.split(',');
|
|
91
|
-
* return {
|
|
92
|
-
* name: "Unknown Location",
|
|
93
|
-
* lat: parseFloat(latStr),
|
|
94
|
-
* lng: parseFloat(lngStr),
|
|
95
|
-
* type: "point"
|
|
96
|
-
* };
|
|
97
|
-
* };
|
|
54
|
+
* // eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
55
|
+
* const fromKey = (key: string) => JSON.parse(key) as Point;
|
|
98
56
|
*
|
|
99
|
-
* const
|
|
57
|
+
* const set = ISetMapped.create<Point, string>(
|
|
100
58
|
* [
|
|
101
|
-
* {
|
|
102
|
-
* {
|
|
59
|
+
* { x: 1, tag: 'a' },
|
|
60
|
+
* { x: 1, tag: 'a' },
|
|
61
|
+
* { x: 2, tag: 'b' },
|
|
103
62
|
* ],
|
|
104
|
-
*
|
|
105
|
-
*
|
|
63
|
+
* toKey,
|
|
64
|
+
* fromKey,
|
|
106
65
|
* );
|
|
107
66
|
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* const keyToUser = (key: string): User => {
|
|
113
|
-
* const [tenant, idStr] = key.split(':');
|
|
114
|
-
* return {
|
|
115
|
-
* id: Number(idStr),
|
|
116
|
-
* tenant,
|
|
117
|
-
* email: `user${idStr}@${tenant}.com`,
|
|
118
|
-
* active: true
|
|
119
|
-
* };
|
|
120
|
-
* };
|
|
121
|
-
*
|
|
122
|
-
* const userSet = ISetMapped.create<User, string>(
|
|
123
|
-
* [],
|
|
124
|
-
* userToKey,
|
|
125
|
-
* keyToUser
|
|
126
|
-
* )
|
|
127
|
-
* .add({ id: 1, tenant: "acme", email: "alice@acme.com", active: true })
|
|
128
|
-
* .add({ id: 2, tenant: "acme", email: "bob@acme.com", active: false });
|
|
129
|
-
*
|
|
130
|
-
* console.log(userSet.size); // Output: 2
|
|
131
|
-
*
|
|
132
|
-
* // Example 4: Empty set with type specification
|
|
133
|
-
* const emptyProductSet = ISetMapped.create<Product, string>(
|
|
134
|
-
* [],
|
|
135
|
-
* productToKey,
|
|
136
|
-
* keyToProduct
|
|
137
|
-
* );
|
|
138
|
-
* console.log(emptyProductSet.isEmpty); // Output: true
|
|
67
|
+
* assert.deepStrictEqual(Array.from(set), [
|
|
68
|
+
* { x: 1, tag: 'a' },
|
|
69
|
+
* { x: 2, tag: 'b' },
|
|
70
|
+
* ]);
|
|
139
71
|
* ```
|
|
72
|
+
*
|
|
73
|
+
* @template K The type of the custom elements.
|
|
74
|
+
* @template KM The type of the mapped primitive keys.
|
|
75
|
+
* @param iterable An iterable of elements using the custom element type.
|
|
76
|
+
* @param toKey A function that converts a custom element `K` to a primitive
|
|
77
|
+
* key `KM`. This function must be deterministic and produce unique values
|
|
78
|
+
* for unique elements.
|
|
79
|
+
* @param fromKey A function that converts a primitive key `KM` back to the
|
|
80
|
+
* custom element `K`. This should be the inverse of `toKey`.
|
|
81
|
+
* @returns A new ISetMapped instance containing all unique elements from the
|
|
82
|
+
* iterable.
|
|
140
83
|
*/
|
|
141
84
|
ISetMapped.create = (iterable, toKey, fromKey) => new ISetMappedClass(iterable, toKey, fromKey);
|
|
142
85
|
/**
|
|
143
86
|
* Checks if two ISetMapped instances are structurally equal.
|
|
144
87
|
*
|
|
145
|
-
* Two ISetMapped instances are considered equal if they have the same size
|
|
146
|
-
* exactly the same elements. The comparison is performed on the
|
|
147
|
-
* so the transformation functions themselves don't
|
|
148
|
-
* compared based on their mapped key
|
|
88
|
+
* Two ISetMapped instances are considered equal if they have the same size
|
|
89
|
+
* and contain exactly the same elements. The comparison is performed on the
|
|
90
|
+
* underlying mapped keys, so the transformation functions themselves don't
|
|
91
|
+
* need to be identical. Elements are compared based on their mapped key
|
|
92
|
+
* representations.
|
|
149
93
|
*
|
|
150
94
|
* **Performance:** O(n) where n is the size of the smaller set.
|
|
151
95
|
*
|
|
152
|
-
* @template K The type of the custom elements.
|
|
153
|
-
* @template KM The type of the mapped primitive keys.
|
|
154
|
-
* @param a The first ISetMapped instance to compare.
|
|
155
|
-
* @param b The second ISetMapped instance to compare.
|
|
156
|
-
* @returns `true` if the sets contain exactly the same elements, `false` otherwise.
|
|
157
|
-
*
|
|
158
96
|
* @example
|
|
159
|
-
* ```typescript
|
|
160
|
-
* // Example with coordinate-based elements
|
|
161
|
-
* type Point = { x: number; y: number; label?: string };
|
|
162
|
-
* const pointToKey = (p: Point): string => `${p.x},${p.y}`;
|
|
163
|
-
* const keyToPoint = (s: string): Point => {
|
|
164
|
-
* const [x, y] = s.split(',').map(Number);
|
|
165
|
-
* return { x, y };
|
|
166
|
-
* };
|
|
167
|
-
*
|
|
168
|
-
* const set1 = ISetMapped.create<Point, string>(
|
|
169
|
-
* [{ x: 1, y: 2, label: "A" }, { x: 3, y: 4, label: "B" }],
|
|
170
|
-
* pointToKey,
|
|
171
|
-
* keyToPoint
|
|
172
|
-
* );
|
|
173
97
|
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* pointToKey,
|
|
177
|
-
* keyToPoint
|
|
178
|
-
* );
|
|
179
|
-
*
|
|
180
|
-
* const set3 = ISetMapped.create<Point, string>(
|
|
181
|
-
* [{ x: 1, y: 2 }, { x: 5, y: 6 }], // Different point
|
|
182
|
-
* pointToKey,
|
|
183
|
-
* keyToPoint
|
|
184
|
-
* );
|
|
98
|
+
* ```ts
|
|
99
|
+
* type Point = Readonly<{ x: number; tag: string }>;
|
|
185
100
|
*
|
|
186
|
-
*
|
|
187
|
-
* console.log(ISetMapped.equal(set1, set3)); // false (different coordinates)
|
|
101
|
+
* const toKey = (point: Point) => JSON.stringify(point);
|
|
188
102
|
*
|
|
189
|
-
* //
|
|
190
|
-
*
|
|
191
|
-
* const userToKey = (u: User): string => `${u.department}:${u.id}`;
|
|
192
|
-
* const keyToUser = (k: string): User => {
|
|
193
|
-
* const [department, idStr] = k.split(':');
|
|
194
|
-
* return { id: Number(idStr), department, name: "" };
|
|
195
|
-
* };
|
|
103
|
+
* // eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
104
|
+
* const fromKey = (key: string) => JSON.parse(key) as Point;
|
|
196
105
|
*
|
|
197
|
-
* const
|
|
106
|
+
* const first = ISetMapped.create<Point, string>(
|
|
198
107
|
* [
|
|
199
|
-
* {
|
|
200
|
-
* {
|
|
108
|
+
* { x: 1, tag: 'a' },
|
|
109
|
+
* { x: 2, tag: 'b' },
|
|
201
110
|
* ],
|
|
202
|
-
*
|
|
203
|
-
*
|
|
111
|
+
* toKey,
|
|
112
|
+
* fromKey,
|
|
204
113
|
* );
|
|
205
|
-
*
|
|
206
|
-
* const users2 = ISetMapped.create<User, string>(
|
|
114
|
+
* const second = ISetMapped.create<Point, string>(
|
|
207
115
|
* [
|
|
208
|
-
* {
|
|
209
|
-
* {
|
|
116
|
+
* { x: 2, tag: 'b' },
|
|
117
|
+
* { x: 1, tag: 'a' },
|
|
210
118
|
* ],
|
|
211
|
-
*
|
|
212
|
-
*
|
|
119
|
+
* toKey,
|
|
120
|
+
* fromKey,
|
|
213
121
|
* );
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
* const empty1 = ISetMapped.create<Point, string>([], pointToKey, keyToPoint);
|
|
219
|
-
* const empty2 = ISetMapped.create<Point, string>([], pointToKey, keyToPoint);
|
|
220
|
-
* console.log(ISetMapped.equal(empty1, empty2)); // true
|
|
221
|
-
*
|
|
222
|
-
* // Sets with different transformation functions but same logical content
|
|
223
|
-
* const alternativePointToKey = (p: Point): string => `(${p.x},${p.y})`; // Different format
|
|
224
|
-
* const alternativeKeyToPoint = (s: string): Point => {
|
|
225
|
-
* const match = s.match(/\((\d+),(\d+)\)/)!;
|
|
226
|
-
* return { x: Number(match[1]), y: Number(match[2]) };
|
|
227
|
-
* };
|
|
228
|
-
*
|
|
229
|
-
* const set4 = ISetMapped.create<Point, string>(
|
|
230
|
-
* [{ x: 1, y: 2 }, { x: 3, y: 4 }],
|
|
231
|
-
* alternativePointToKey,
|
|
232
|
-
* alternativeKeyToPoint
|
|
122
|
+
* const third = ISetMapped.create<Point, string>(
|
|
123
|
+
* [{ x: 3, tag: 'c' }],
|
|
124
|
+
* toKey,
|
|
125
|
+
* fromKey,
|
|
233
126
|
* );
|
|
234
127
|
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
128
|
+
* assert.ok(ISetMapped.equal(first, second));
|
|
129
|
+
* assert.notOk(ISetMapped.equal(first, third));
|
|
237
130
|
* ```
|
|
131
|
+
*
|
|
132
|
+
* @template K The type of the custom elements.
|
|
133
|
+
* @template KM The type of the mapped primitive keys.
|
|
134
|
+
* @param a The first ISetMapped instance to compare.
|
|
135
|
+
* @param b The second ISetMapped instance to compare.
|
|
136
|
+
* @returns `true` if the sets contain exactly the same elements, `false`
|
|
137
|
+
* otherwise.
|
|
238
138
|
*/
|
|
239
139
|
ISetMapped.equal = (a, b) => a.size === b.size && a.every((e) => b.has(e));
|
|
240
140
|
/**
|
|
241
141
|
* Computes the difference between two ISetMapped instances.
|
|
242
|
-
*
|
|
243
|
-
* @template KM The type of the mapped keys.
|
|
244
|
-
* @param oldSet The original set.
|
|
245
|
-
* @param newSet The new set.
|
|
246
|
-
* @returns An object containing sets of added and deleted elements.
|
|
142
|
+
*
|
|
247
143
|
* @example
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
144
|
+
*
|
|
145
|
+
* ```ts
|
|
146
|
+
* type Point = Readonly<{ x: number; tag: string }>;
|
|
147
|
+
*
|
|
148
|
+
* const toKey = (point: Point) => JSON.stringify(point);
|
|
149
|
+
*
|
|
150
|
+
* // eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
151
|
+
* const fromKey = (key: string) => JSON.parse(key) as Point;
|
|
152
|
+
*
|
|
153
|
+
* const previous = ISetMapped.create<Point, string>(
|
|
154
|
+
* [
|
|
155
|
+
* { x: 1, tag: 'a' },
|
|
156
|
+
* { x: 2, tag: 'b' },
|
|
157
|
+
* ],
|
|
158
|
+
* toKey,
|
|
159
|
+
* fromKey,
|
|
257
160
|
* );
|
|
258
|
-
* const
|
|
259
|
-
* [
|
|
260
|
-
*
|
|
261
|
-
*
|
|
161
|
+
* const current = ISetMapped.create<Point, string>(
|
|
162
|
+
* [
|
|
163
|
+
* { x: 2, tag: 'b' },
|
|
164
|
+
* { x: 3, tag: 'c' },
|
|
165
|
+
* ],
|
|
166
|
+
* toKey,
|
|
167
|
+
* fromKey,
|
|
262
168
|
* );
|
|
263
169
|
*
|
|
264
|
-
* const
|
|
265
|
-
*
|
|
266
|
-
* console.log("Deleted tags:", diffResult.deleted.toArray().map(t => t.name));
|
|
267
|
-
* // Output: Deleted tags: ["typescript"]
|
|
170
|
+
* const { added, deleted } = ISetMapped.diff(previous, current);
|
|
268
171
|
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
172
|
+
* assert.deepStrictEqual(Array.from(added), [{ x: 3, tag: 'c' }]);
|
|
173
|
+
* assert.deepStrictEqual(Array.from(deleted), [{ x: 1, tag: 'a' }]);
|
|
271
174
|
* ```
|
|
175
|
+
*
|
|
176
|
+
* @template K The type of the elements.
|
|
177
|
+
* @template KM The type of the mapped keys.
|
|
178
|
+
* @param oldSet The original set.
|
|
179
|
+
* @param newSet The new set.
|
|
180
|
+
* @returns An object containing sets of added and deleted elements.
|
|
272
181
|
*/
|
|
273
182
|
ISetMapped.diff = (oldSet, newSet) => ({
|
|
274
183
|
deleted: oldSet.subtract(newSet),
|
|
@@ -276,73 +185,95 @@ var ISetMapped;
|
|
|
276
185
|
});
|
|
277
186
|
/**
|
|
278
187
|
* Computes the intersection of two ISetMapped instances.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
*
|
|
191
|
+
* ```ts
|
|
192
|
+
* type Point = Readonly<{ x: number; tag: string }>;
|
|
193
|
+
*
|
|
194
|
+
* const toKey = (point: Point) => JSON.stringify(point);
|
|
195
|
+
*
|
|
196
|
+
* // eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
197
|
+
* const fromKey = (key: string) => JSON.parse(key) as Point;
|
|
198
|
+
*
|
|
199
|
+
* const left = ISetMapped.create<Point, string>(
|
|
200
|
+
* [
|
|
201
|
+
* { x: 1, tag: 'a' },
|
|
202
|
+
* { x: 2, tag: 'b' },
|
|
203
|
+
* ],
|
|
204
|
+
* toKey,
|
|
205
|
+
* fromKey,
|
|
206
|
+
* );
|
|
207
|
+
* const right = ISetMapped.create<Point, string>(
|
|
208
|
+
* [{ x: 2, tag: 'b' }],
|
|
209
|
+
* toKey,
|
|
210
|
+
* fromKey,
|
|
211
|
+
* );
|
|
212
|
+
*
|
|
213
|
+
* const overlap = ISetMapped.intersection(left, right);
|
|
214
|
+
*
|
|
215
|
+
* assert.deepStrictEqual(Array.from(overlap), [{ x: 2, tag: 'b' }]);
|
|
216
|
+
* ```
|
|
217
|
+
*
|
|
279
218
|
* @template K The type of the elements.
|
|
280
219
|
* @template KM The type of the mapped keys.
|
|
281
220
|
* @param a The first set.
|
|
282
221
|
* @param b The second set.
|
|
283
222
|
* @returns A new ISetMapped instance representing the intersection.
|
|
223
|
+
*/
|
|
224
|
+
ISetMapped.intersection = (a, b) => a.intersect(b);
|
|
225
|
+
/**
|
|
226
|
+
* Computes the union of two ISetMapped instances.
|
|
227
|
+
*
|
|
284
228
|
* @example
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
229
|
+
*
|
|
230
|
+
* ```ts
|
|
231
|
+
* type Point = Readonly<{ x: number; tag: string }>;
|
|
232
|
+
*
|
|
233
|
+
* const toKey = (point: Point) => JSON.stringify(point);
|
|
234
|
+
*
|
|
235
|
+
* // eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
236
|
+
* const fromKey = (key: string) => JSON.parse(key) as Point;
|
|
237
|
+
*
|
|
238
|
+
* const left = ISetMapped.create<Point, string>(
|
|
239
|
+
* [{ x: 1, tag: 'a' }],
|
|
240
|
+
* toKey,
|
|
241
|
+
* fromKey,
|
|
294
242
|
* );
|
|
295
|
-
* const
|
|
296
|
-
* [{
|
|
297
|
-
*
|
|
298
|
-
*
|
|
243
|
+
* const right = ISetMapped.create<Point, string>(
|
|
244
|
+
* [{ x: 2, tag: 'b' }],
|
|
245
|
+
* toKey,
|
|
246
|
+
* fromKey,
|
|
299
247
|
* );
|
|
300
248
|
*
|
|
301
|
-
* const
|
|
302
|
-
*
|
|
249
|
+
* const combined = ISetMapped.union(left, right);
|
|
250
|
+
*
|
|
251
|
+
* assert.deepStrictEqual(Array.from(combined), [
|
|
252
|
+
* { x: 1, tag: 'a' },
|
|
253
|
+
* { x: 2, tag: 'b' },
|
|
254
|
+
* ]);
|
|
303
255
|
* ```
|
|
304
|
-
|
|
305
|
-
ISetMapped.intersection = (a, b) => a.intersect(b);
|
|
306
|
-
/**
|
|
307
|
-
* Computes the union of two ISetMapped instances.
|
|
256
|
+
*
|
|
308
257
|
* @template K The type of the elements.
|
|
309
258
|
* @template KM The type of the mapped keys.
|
|
310
259
|
* @param a The first set.
|
|
311
260
|
* @param b The second set.
|
|
312
261
|
* @returns A new ISetMapped instance representing the union.
|
|
313
|
-
* @example
|
|
314
|
-
* ```typescript
|
|
315
|
-
* type FeatureFlag = { flagName: string };
|
|
316
|
-
* const flagToKey = (f: FeatureFlag): string => f.flagName;
|
|
317
|
-
* const keyToFlag = (name: string): FeatureFlag => ({ flagName: name });
|
|
318
|
-
*
|
|
319
|
-
* const setA = ISetMapped.create<FeatureFlag, string>(
|
|
320
|
-
* [{ flagName: "newUI" }, { flagName: "betaFeature" }],
|
|
321
|
-
* flagToKey,
|
|
322
|
-
* keyToFlag
|
|
323
|
-
* );
|
|
324
|
-
* const setB = ISetMapped.create<FeatureFlag, string>(
|
|
325
|
-
* [{ flagName: "betaFeature" }, { flagName: "darkMode" }],
|
|
326
|
-
* flagToKey,
|
|
327
|
-
* keyToFlag
|
|
328
|
-
* );
|
|
329
|
-
*
|
|
330
|
-
* const combinedFlags = ISetMapped.union(setA, setB);
|
|
331
|
-
* // The order might vary as sets are unordered internally.
|
|
332
|
-
* console.log(combinedFlags.toArray().map(f => f.flagName).toSorted());
|
|
333
|
-
* // Output: ["betaFeature", "darkMode", "newUI"]
|
|
334
|
-
* ```
|
|
335
262
|
*/
|
|
336
263
|
ISetMapped.union = (a, b) => a.union(b);
|
|
337
264
|
})(ISetMapped || (ISetMapped = {}));
|
|
338
265
|
/**
|
|
339
|
-
* Internal class implementation for ISetMapped providing immutable set
|
|
266
|
+
* Internal class implementation for ISetMapped providing immutable set
|
|
267
|
+
* operations with element transformation.
|
|
340
268
|
*
|
|
341
|
-
* This class implements the ISetMapped interface by maintaining a JavaScript
|
|
342
|
-
* internally while exposing an API that works with
|
|
343
|
-
* custom
|
|
269
|
+
* This class implements the ISetMapped interface by maintaining a JavaScript
|
|
270
|
+
* Set with primitive keys internally while exposing an API that works with
|
|
271
|
+
* custom element types. The transformation between custom and primitive
|
|
272
|
+
* elements is handled transparently through the provided `toKey` and `fromKey`
|
|
273
|
+
* functions.
|
|
344
274
|
*
|
|
345
275
|
* **Implementation Details:**
|
|
276
|
+
*
|
|
346
277
|
* - Uses ReadonlySet<KM> internally where KM is the primitive key type
|
|
347
278
|
* - Stores transformation functions for bidirectional element conversion
|
|
348
279
|
* - Implements copy-on-write semantics for efficiency
|
|
@@ -363,13 +294,13 @@ class ISetMappedClass {
|
|
|
363
294
|
* Constructs an ISetMappedClass instance with custom element transformation.
|
|
364
295
|
*
|
|
365
296
|
* @param iterable An iterable of elements using the custom element type K.
|
|
366
|
-
* @param toKey A function that converts a custom element K to a primitive key
|
|
367
|
-
*
|
|
368
|
-
* @param fromKey A function that converts a primitive key KM back to the
|
|
369
|
-
*
|
|
297
|
+
* @param toKey A function that converts a custom element K to a primitive key
|
|
298
|
+
* KM. Must be deterministic and produce unique values for unique elements.
|
|
299
|
+
* @param fromKey A function that converts a primitive key KM back to the
|
|
300
|
+
* custom element K. Should be the inverse of the toKey function.
|
|
370
301
|
* @param showNotFoundMessage Whether to log warning messages when operations
|
|
371
|
-
*
|
|
372
|
-
*
|
|
302
|
+
* are performed on non-existent elements. Useful for debugging. Defaults to
|
|
303
|
+
* false for production use.
|
|
373
304
|
* @internal Use ISetMapped.create() instead of calling this constructor directly.
|
|
374
305
|
*/
|
|
375
306
|
constructor(iterable, toKey, fromKey, showNotFoundMessage = false) {
|
|
@@ -480,6 +411,33 @@ class ISetMappedClass {
|
|
|
480
411
|
return ISetMapped.create([...this.values(), ...set.values()], this.#toKey, this.#fromKey);
|
|
481
412
|
}
|
|
482
413
|
/**
|
|
414
|
+
* @example
|
|
415
|
+
*
|
|
416
|
+
* ```ts
|
|
417
|
+
* type Point = Readonly<{ x: number; tag: string }>;
|
|
418
|
+
*
|
|
419
|
+
* const toKey = (point: Point) => JSON.stringify(point);
|
|
420
|
+
*
|
|
421
|
+
* // eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
422
|
+
* const fromKey = (key: string) => JSON.parse(key) as Point;
|
|
423
|
+
*
|
|
424
|
+
* const set = ISetMapped.create<Point, string>(
|
|
425
|
+
* [
|
|
426
|
+
* { x: 1, tag: 'a' },
|
|
427
|
+
* { x: 2, tag: 'b' },
|
|
428
|
+
* ],
|
|
429
|
+
* toKey,
|
|
430
|
+
* fromKey,
|
|
431
|
+
* );
|
|
432
|
+
*
|
|
433
|
+
* const collected = Array.from(set);
|
|
434
|
+
*
|
|
435
|
+
* assert.deepStrictEqual(collected, [
|
|
436
|
+
* { x: 1, tag: 'a' },
|
|
437
|
+
* { x: 2, tag: 'b' },
|
|
438
|
+
* ]);
|
|
439
|
+
* ```
|
|
440
|
+
*
|
|
483
441
|
* @inheritdoc
|
|
484
442
|
*/
|
|
485
443
|
*[Symbol.iterator]() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iset-mapped.mjs","sources":["../../src/collections/iset-mapped.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"iset-mapped.mjs","sources":["../../src/collections/iset-mapped.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAu2BA;AACM,IAAW;AAAjB,CAAA,UAAiB,UAAU,EAAA;AACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDG;AACU,IAAA,UAAA,CAAA,MAAM,GAAG,CACpB,QAAqB,EACrB,KAAmB,EACnB,OAAqB,KACC,IAAI,eAAe,CAAQ,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDG;AACU,IAAA,UAAA,CAAA,KAAK,GAAG,CACnB,CAAoB,EACpB,CAAoB,KACR,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCG;IACU,UAAA,CAAA,IAAI,GAAG,CAClB,MAAyB,EACzB,MAAyB,MACmC;AAC5D,QAAA,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;AAChC,QAAA,KAAK,EAAE,MAAM,CAA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