ts-data-forge 3.2.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 +45 -21
- 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 +3 -0
- package/dist/entry-point.d.mts.map +1 -0
- package/dist/entry-point.mjs +62 -0
- package/dist/entry-point.mjs.map +1 -0
- 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 +14 -127
- 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/dist/types.d.mts +1 -1
- package/package.json +54 -50
- 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 +2 -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-record.test.mts +0 -1
- 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 +15 -127
- package/src/others/unknown-to-string.test.mts +14 -2
- 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
|
@@ -3,11 +3,13 @@ import { isNonNullish } from '../guard/is-type.mjs';
|
|
|
3
3
|
/**
|
|
4
4
|
* Converts an unknown value to its string representation in a type-safe manner.
|
|
5
5
|
*
|
|
6
|
-
* This function handles all JavaScript types and provides consistent string
|
|
7
|
-
* with proper error handling for edge cases like circular
|
|
8
|
-
* toString() calls, this function never throws and
|
|
6
|
+
* This function handles all JavaScript types and provides consistent string
|
|
7
|
+
* conversion with proper error handling for edge cases like circular
|
|
8
|
+
* references. Unlike naive toString() calls, this function never throws and
|
|
9
|
+
* handles all value types gracefully.
|
|
9
10
|
*
|
|
10
11
|
* **Type conversion rules:**
|
|
12
|
+
*
|
|
11
13
|
* - Strings: returned as-is
|
|
12
14
|
* - Numbers, booleans, bigints: converted via toString()
|
|
13
15
|
* - Symbols: converted to their description string
|
|
@@ -18,137 +20,22 @@ import { isNonNullish } from '../guard/is-type.mjs';
|
|
|
18
20
|
*
|
|
19
21
|
* @param value - The unknown value to convert to string
|
|
20
22
|
* @param options - Optional configuration for the conversion
|
|
21
|
-
* @param options.prettyPrintObject - If true, objects are formatted with
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* ```typescript
|
|
26
|
-
* // Primitive types
|
|
27
|
-
* unknownToString('hello'); // 'hello'
|
|
28
|
-
* unknownToString(123); // '123'
|
|
29
|
-
* unknownToString(true); // 'true'
|
|
30
|
-
* unknownToString(null); // 'null'
|
|
31
|
-
* unknownToString(undefined); // 'undefined'
|
|
32
|
-
* unknownToString(Symbol('test')); // 'Symbol(test)'
|
|
33
|
-
* unknownToString(123n); // '123'
|
|
34
|
-
*
|
|
35
|
-
* // Function conversion
|
|
36
|
-
* const fn = () => 'test';
|
|
37
|
-
* unknownToString(fn); // "() => 'test'"
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* @example Object stringification
|
|
41
|
-
* ```typescript
|
|
42
|
-
* // Simple object
|
|
43
|
-
* const obj = { a: 1, b: 'hello', c: [1, 2, 3] };
|
|
44
|
-
* const result = unknownToString(obj);
|
|
45
|
-
* console.log(result); // '{"a":1,"b":"hello","c":[1,2,3]}'
|
|
46
|
-
*
|
|
47
|
-
* // Pretty printing
|
|
48
|
-
* const prettyResult = unknownToString(obj, { prettyPrintObject: true });
|
|
49
|
-
* console.log(prettyResult);
|
|
50
|
-
* // {
|
|
51
|
-
* // "a": 1,
|
|
52
|
-
* // "b": "hello",
|
|
53
|
-
* // "c": [
|
|
54
|
-
* // 1,
|
|
55
|
-
* // 2,
|
|
56
|
-
* // 3
|
|
57
|
-
* // ]
|
|
58
|
-
* // }
|
|
59
|
-
* ```
|
|
60
|
-
*
|
|
61
|
-
* @example Error handling for circular references
|
|
62
|
-
* ```typescript
|
|
63
|
-
* // Circular reference
|
|
64
|
-
* const circular: any = { name: 'parent' };
|
|
65
|
-
* circular.self = circular;
|
|
66
|
-
*
|
|
67
|
-
* const result = unknownToString(circular);
|
|
68
|
-
* console.log(result); // "Converting circular structure to JSON"
|
|
69
|
-
*
|
|
70
|
-
* @example Logging and debugging utilities
|
|
71
|
-
* ```typescript
|
|
72
|
-
* // Type-safe logger
|
|
73
|
-
* class Logger {
|
|
74
|
-
* log(message: string, data?: unknown): void {
|
|
75
|
-
* const timestamp = new Date().toISOString();
|
|
76
|
-
* const dataStr = data !== undefined
|
|
77
|
-
* ? unknownToString(data, { prettyPrintObject: true })
|
|
78
|
-
* : '';
|
|
79
|
-
*
|
|
80
|
-
* console.log(`[${timestamp}] ${message}`, dataStr);
|
|
81
|
-
* }
|
|
82
|
-
* }
|
|
83
|
-
*
|
|
84
|
-
* const logger = new Logger();
|
|
85
|
-
* logger.log('User data:', { id: 123, name: 'John' });
|
|
86
|
-
* ```
|
|
87
|
-
*
|
|
88
|
-
* @example API response formatting
|
|
89
|
-
* ```typescript
|
|
90
|
-
* // Safe error response formatting
|
|
91
|
-
* function formatErrorResponse(error: unknown): string {
|
|
92
|
-
* const errorStr = unknownToString(error, { prettyPrintObject: true });
|
|
23
|
+
* @param options.prettyPrintObject - If true, objects are formatted with
|
|
24
|
+
* 2-space indentation
|
|
25
|
+
* @returns The string representation of the value. For circular references or
|
|
26
|
+
* non-serializable objects, returns an error message string
|
|
93
27
|
*
|
|
94
|
-
* return
|
|
95
|
-
*
|
|
96
|
-
* error: errorStr
|
|
97
|
-
* });
|
|
98
|
-
* }
|
|
99
|
-
*
|
|
100
|
-
* try {
|
|
101
|
-
* // some operation
|
|
102
|
-
* } catch (error) {
|
|
103
|
-
* const response = formatErrorResponse(error);
|
|
104
|
-
* res.status(500).send(response);
|
|
105
|
-
* }
|
|
106
|
-
* ```
|
|
107
|
-
*
|
|
108
|
-
* @example Working with special objects
|
|
109
|
-
* ```typescript
|
|
110
|
-
* // Date objects
|
|
111
|
-
* unknownToString(new Date('2023-01-01'));
|
|
112
|
-
* // '"2023-01-01T00:00:00.000Z"' - JSON stringified
|
|
113
|
-
*
|
|
114
|
-
* // Regular expressions
|
|
115
|
-
* unknownToString(/test/gi);
|
|
116
|
-
* // '{}' - RegExp has no enumerable properties
|
|
117
|
-
*
|
|
118
|
-
* // Arrays
|
|
119
|
-
* unknownToString([1, 'two', { three: 3 }]);
|
|
120
|
-
* // '[1,"two",{"three":3}]'
|
|
121
|
-
*
|
|
122
|
-
* // Map and Set (converted to empty objects by JSON.stringify)
|
|
123
|
-
* unknownToString(new Map([['a', 1]])); // '{}'
|
|
124
|
-
* unknownToString(new Set([1, 2, 3])); // '{}'
|
|
125
|
-
* ```
|
|
126
|
-
*
|
|
127
|
-
* @example Using with validation
|
|
128
|
-
* ```typescript
|
|
129
|
-
* // Simple validation helper
|
|
130
|
-
* function validateAndStringify(input: unknown): string {
|
|
131
|
-
* const str = unknownToString(input);
|
|
132
|
-
* const trimmed = str.trim();
|
|
133
|
-
*
|
|
134
|
-
* if (trimmed.length === 0) {
|
|
135
|
-
* throw new Error('Empty string');
|
|
136
|
-
* }
|
|
137
|
-
*
|
|
138
|
-
* return trimmed;
|
|
139
|
-
* }
|
|
140
|
-
* ```
|
|
141
|
-
*
|
|
142
|
-
* **Error Handling:**
|
|
143
|
-
* Circular references and non-serializable objects return descriptive error messages instead of throwing
|
|
28
|
+
* **Error Handling:** Circular references and non-serializable objects return
|
|
29
|
+
* descriptive error messages instead of throwing
|
|
144
30
|
* @see JSON.stringify - Underlying serialization for objects
|
|
145
31
|
*/
|
|
146
32
|
const unknownToString = (value, options) => {
|
|
147
33
|
switch (typeof value) {
|
|
148
34
|
case 'string':
|
|
149
35
|
return value;
|
|
150
|
-
case 'number':
|
|
151
36
|
case 'bigint':
|
|
37
|
+
return `${value.toString()}n`;
|
|
38
|
+
case 'number':
|
|
152
39
|
case 'boolean':
|
|
153
40
|
case 'symbol':
|
|
154
41
|
case 'function':
|
|
@@ -164,7 +51,7 @@ const unknownToString = (value, options) => {
|
|
|
164
51
|
return stringified;
|
|
165
52
|
}
|
|
166
53
|
catch (error) {
|
|
167
|
-
return error
|
|
54
|
+
return Error.isError(error)
|
|
168
55
|
? error.message
|
|
169
56
|
: '[Circular or Non-serializable]';
|
|
170
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unknown-to-string.mjs","sources":["../../src/others/unknown-to-string.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA
|
|
1
|
+
{"version":3,"file":"unknown-to-string.mjs","sources":["../../src/others/unknown-to-string.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;MACU,eAAe,GAAG,CAC7B,KAAc,EACd,OAA2D,KACjD;IACV,QAAQ,OAAO,KAAK;AAClB,QAAA,KAAK,QAAQ;AACX,YAAA,OAAO,KAAK;AAEd,QAAA,KAAK,QAAQ;AACX,YAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG;AAE/B,QAAA,KAAK,QAAQ;AACb,QAAA,KAAK,SAAS;AACd,QAAA,KAAK,QAAQ;AACb,QAAA,KAAK,UAAU;AACb,YAAA,OAAO,KAAK,CAAC,QAAQ,EAAE;AAEzB,QAAA,KAAK,QAAQ;AACX,YAAA,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;AACxB,gBAAA,OAAO,MAAM;YACf;AACA,YAAA,IAAI;AACF,gBAAA,MAAM,WAAW,GACf,OAAO,EAAE,iBAAiB,KAAK;sBAC3B,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC;AACpC,sBAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;AAC3B,gBAAA,OAAO,WAAW;YACpB;YAAE,OAAO,KAAK,EAAE;AACd,gBAAA,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK;sBACtB,KAAK,CAAC;sBACN,gCAAgC;YACtC;AAEF,QAAA,KAAK,WAAW;AACd,YAAA,OAAO,WAAW;;AAExB;;;;"}
|
|
@@ -1,32 +1,45 @@
|
|
|
1
1
|
import { Result } from '../functional/index.mjs';
|
|
2
2
|
/**
|
|
3
|
-
* Creates a Promise that wraps the result in a Result type for type-safe error
|
|
4
|
-
* This function is an alternative to `new Promise(executor)` that
|
|
5
|
-
* by returning a Result type instead of throwing
|
|
6
|
-
*
|
|
7
|
-
* @template S - The type of successful value
|
|
8
|
-
* @template E - The type of error value
|
|
9
|
-
* @param executor - Function that takes resolve and reject callbacks
|
|
10
|
-
* @returns A Promise that resolves to a Result containing either success or error
|
|
3
|
+
* Creates a Promise that wraps the result in a Result type for type-safe error
|
|
4
|
+
* handling. This function is an alternative to `new Promise(executor)` that
|
|
5
|
+
* provides enhanced type safety by returning a Result type instead of throwing
|
|
6
|
+
* exceptions.
|
|
11
7
|
*
|
|
12
8
|
* @example
|
|
13
|
-
*
|
|
14
|
-
*
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* // Create a promise that resolves successfully
|
|
12
|
+
* const successPromise = createPromise<number, string>((resolve) => {
|
|
13
|
+
* setTimeout(() => {
|
|
14
|
+
* resolve(42);
|
|
15
|
+
* }, 0);
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* const successResult = await successPromise;
|
|
19
|
+
* assert.ok(Result.isOk(successResult));
|
|
20
|
+
* if (Result.isOk(successResult)) {
|
|
21
|
+
* assert(successResult.value === 42);
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* // Create a promise that rejects with an error
|
|
25
|
+
* const errorPromise = createPromise<number, string>((_, reject) => {
|
|
15
26
|
* setTimeout(() => {
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* } else {
|
|
19
|
-
* reject(new Error("Failed"));
|
|
20
|
-
* }
|
|
21
|
-
* }, 1000);
|
|
27
|
+
* reject('Something went wrong');
|
|
28
|
+
* }, 0);
|
|
22
29
|
* });
|
|
23
30
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
31
|
+
* const errorResult = await errorPromise;
|
|
32
|
+
* assert.ok(Result.isErr(errorResult));
|
|
33
|
+
* if (Result.isErr(errorResult)) {
|
|
34
|
+
* assert(errorResult.value === 'Something went wrong');
|
|
28
35
|
* }
|
|
29
36
|
* ```
|
|
37
|
+
*
|
|
38
|
+
* @template S - The type of successful value
|
|
39
|
+
* @template E - The type of error value
|
|
40
|
+
* @param executor - Function that takes resolve and reject callbacks
|
|
41
|
+
* @returns A Promise that resolves to a Result containing either success or
|
|
42
|
+
* error
|
|
30
43
|
*/
|
|
31
44
|
export declare const createPromise: <S, E>(executor: (resolve: (value: S) => void, reject: (reason?: E) => void) => void) => Promise<Result<S, E>>;
|
|
32
45
|
//# sourceMappingURL=promise.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise.d.mts","sourceRoot":"","sources":["../../src/promise/promise.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD
|
|
1
|
+
{"version":3,"file":"promise.d.mts","sourceRoot":"","sources":["../../src/promise/promise.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,CAAC,EAChC,UAAU,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,IAAI,KAAK,IAAI,KAC5E,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAIK,CAAC"}
|
package/dist/promise/promise.mjs
CHANGED
|
@@ -2,36 +2,49 @@ import '../functional/optional.mjs';
|
|
|
2
2
|
import { Result } from '../functional/result.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Creates a Promise that wraps the result in a Result type for type-safe error
|
|
6
|
-
* This function is an alternative to `new Promise(executor)` that
|
|
7
|
-
* by returning a Result type instead of throwing
|
|
8
|
-
*
|
|
9
|
-
* @template S - The type of successful value
|
|
10
|
-
* @template E - The type of error value
|
|
11
|
-
* @param executor - Function that takes resolve and reject callbacks
|
|
12
|
-
* @returns A Promise that resolves to a Result containing either success or error
|
|
5
|
+
* Creates a Promise that wraps the result in a Result type for type-safe error
|
|
6
|
+
* handling. This function is an alternative to `new Promise(executor)` that
|
|
7
|
+
* provides enhanced type safety by returning a Result type instead of throwing
|
|
8
|
+
* exceptions.
|
|
13
9
|
*
|
|
14
10
|
* @example
|
|
15
|
-
*
|
|
16
|
-
*
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* // Create a promise that resolves successfully
|
|
14
|
+
* const successPromise = createPromise<number, string>((resolve) => {
|
|
15
|
+
* setTimeout(() => {
|
|
16
|
+
* resolve(42);
|
|
17
|
+
* }, 0);
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* const successResult = await successPromise;
|
|
21
|
+
* assert.ok(Result.isOk(successResult));
|
|
22
|
+
* if (Result.isOk(successResult)) {
|
|
23
|
+
* assert(successResult.value === 42);
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* // Create a promise that rejects with an error
|
|
27
|
+
* const errorPromise = createPromise<number, string>((_, reject) => {
|
|
17
28
|
* setTimeout(() => {
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* } else {
|
|
21
|
-
* reject(new Error("Failed"));
|
|
22
|
-
* }
|
|
23
|
-
* }, 1000);
|
|
29
|
+
* reject('Something went wrong');
|
|
30
|
+
* }, 0);
|
|
24
31
|
* });
|
|
25
32
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
33
|
+
* const errorResult = await errorPromise;
|
|
34
|
+
* assert.ok(Result.isErr(errorResult));
|
|
35
|
+
* if (Result.isErr(errorResult)) {
|
|
36
|
+
* assert(errorResult.value === 'Something went wrong');
|
|
30
37
|
* }
|
|
31
38
|
* ```
|
|
39
|
+
*
|
|
40
|
+
* @template S - The type of successful value
|
|
41
|
+
* @template E - The type of error value
|
|
42
|
+
* @param executor - Function that takes resolve and reject callbacks
|
|
43
|
+
* @returns A Promise that resolves to a Result containing either success or
|
|
44
|
+
* error
|
|
32
45
|
*/
|
|
33
46
|
const createPromise = (executor) =>
|
|
34
|
-
// eslint-disable-next-line
|
|
47
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
35
48
|
Result.fromPromise(new Promise(executor));
|
|
36
49
|
|
|
37
50
|
export { createPromise };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise.mjs","sources":["../../src/promise/promise.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAEA
|
|
1
|
+
{"version":3,"file":"promise.mjs","sources":["../../src/promise/promise.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCG;AACI,MAAM,aAAa,GAAG,CAC3B,QAA6E;AAE7E;AACA,MAAM,CAAC,WAAW,CAAC,IAAI,OAAO,CAAI,QAAQ,CAAC;;;;"}
|
package/dist/types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import './globals.d.mts';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './entry-point.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-data-forge",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
".": {
|
|
23
23
|
"import": {
|
|
24
24
|
"types": "./dist/types.d.mts",
|
|
25
|
-
"default": "./dist/
|
|
25
|
+
"default": "./dist/entry-point.mjs"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
-
"module": "./dist/
|
|
29
|
+
"module": "./dist/entry-point.mjs",
|
|
30
30
|
"types": "./dist/types.d.mts",
|
|
31
31
|
"files": [
|
|
32
32
|
"src",
|
|
@@ -35,41 +35,50 @@
|
|
|
35
35
|
"LICENSE"
|
|
36
36
|
],
|
|
37
37
|
"scripts": {
|
|
38
|
-
"build": "tsx ./scripts/cmd/build.
|
|
39
|
-
"check-all": "tsx ./scripts/cmd/check-all.
|
|
40
|
-
"check:ext": "tsx ./scripts/cmd/check-ext.
|
|
38
|
+
"build": "tsx ./scripts/cmd/build.mts",
|
|
39
|
+
"check-all": "tsx ./scripts/cmd/check-all.mts",
|
|
40
|
+
"check:ext": "tsx ./scripts/cmd/check-ext.mts",
|
|
41
41
|
"cspell": "cspell \"**\" --gitignore --gitignore-root ./ --no-progress",
|
|
42
|
-
"doc": "tsx ./scripts/cmd/gen-docs.
|
|
43
|
-
"
|
|
42
|
+
"doc": "tsx ./scripts/cmd/gen-docs.mts",
|
|
43
|
+
"doc:embed-doc": "tsx ./scripts/cmd/embed-samples.mts",
|
|
44
|
+
"doc:embed-jsdoc": "tsx ./scripts/cmd/embed-jsdoc-examples.mts",
|
|
45
|
+
"doc:preview": "vite preview --config ./configs/vite.doc.config.ts",
|
|
46
|
+
"doc:watch": "typedoc --options ./configs/typedoc.config.mjs --watch",
|
|
47
|
+
"fmt": "format-uncommitted",
|
|
48
|
+
"fmt:diff": "format-diff-from origin/main",
|
|
44
49
|
"fmt:full": "prettier --write .",
|
|
45
|
-
"
|
|
50
|
+
"gh:apply-all": "run-s gh:apply-variables gh:apply-rulesets gh:apply-repository-settings",
|
|
51
|
+
"gh:apply-repository-settings": "tsx --env-file=.env scripts/github/repository/apply.mts",
|
|
52
|
+
"gh:apply-rulesets": "tsx --env-file=.env scripts/github/ruleset/apply.mts",
|
|
53
|
+
"gh:apply-variables": "tsx --env-file=.env scripts/github/variables/apply.mts",
|
|
54
|
+
"gh:backup-all": "run-s gh:backup-rulesets gh:backup-repository-settings",
|
|
55
|
+
"gh:backup-repository-settings": "tsx --env-file=.env scripts/github/repository/backup.mts",
|
|
56
|
+
"gh:backup-rulesets": "tsx --env-file=.env scripts/github/ruleset/backup.mts",
|
|
57
|
+
"gi": "run-s gi:scripts gi:src fmt",
|
|
58
|
+
"gi:scripts": "gen-index-ts ./scripts/github --index-ext .mts --export-ext .mjs --target-ext .mts --exclude cmd --exclude apply.mts --exclude octokit.mts",
|
|
59
|
+
"gi:src": "gen-index-ts ./src --index-ext .mts --export-ext .mjs --target-ext .mts --target-ext .tsx --exclude entry-point.mts --exclude array",
|
|
46
60
|
"lint": "eslint .",
|
|
47
61
|
"lint:fix": "eslint . --fix",
|
|
48
|
-
"lint:samples": "eslint ./samples",
|
|
49
62
|
"md": "markdownlint-cli2",
|
|
50
|
-
"test": "
|
|
51
|
-
"test:cov": "
|
|
63
|
+
"test": "pnpm run z:vitest run",
|
|
64
|
+
"test:cov": "pnpm run z:vitest run --coverage",
|
|
52
65
|
"test:cov:ui": "vite preview --outDir ./coverage",
|
|
53
|
-
"test:
|
|
54
|
-
"
|
|
55
|
-
"testw": "npm run z:vitest -- watch",
|
|
56
|
-
"testw:samples": "npm run test:samples -- watch",
|
|
66
|
+
"test:ui": "pnpm run z:vitest --ui",
|
|
67
|
+
"testw": "pnpm run z:vitest watch",
|
|
57
68
|
"tsc": "tsc --noEmit",
|
|
58
69
|
"tscw": "tsc --noEmit --watch -p ./tsconfig.json",
|
|
59
|
-
"tscw:samples": "tsc --noEmit --watch -p ./samples/tsconfig.json",
|
|
60
70
|
"type-check": "tsc --noEmit",
|
|
61
|
-
"
|
|
62
|
-
"update-packages": "npx npm-check-updates -u --install always",
|
|
71
|
+
"update-packages": "pnpm update --latest",
|
|
63
72
|
"z:vitest": "vitest --config ./configs/vitest.config.ts"
|
|
64
73
|
},
|
|
65
74
|
"dependencies": {
|
|
66
|
-
"ts-type-forge": "^2.
|
|
75
|
+
"ts-type-forge": "^2.3.0"
|
|
67
76
|
},
|
|
68
77
|
"devDependencies": {
|
|
69
78
|
"@emotion/react": "^11.14.0",
|
|
70
79
|
"@emotion/styled": "^11.14.1",
|
|
71
|
-
"@
|
|
72
|
-
"@
|
|
80
|
+
"@mui/material": "^7.3.4",
|
|
81
|
+
"@octokit/core": "^7.0.5",
|
|
73
82
|
"@rollup/plugin-replace": "^6.0.2",
|
|
74
83
|
"@rollup/plugin-strip": "^3.0.4",
|
|
75
84
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
@@ -77,45 +86,40 @@
|
|
|
77
86
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
78
87
|
"@semantic-release/exec": "^7.1.0",
|
|
79
88
|
"@semantic-release/git": "^10.0.1",
|
|
80
|
-
"@semantic-release/github": "^
|
|
81
|
-
"@semantic-release/npm": "^
|
|
82
|
-
"@semantic-release/release-notes-generator": "^14.0
|
|
83
|
-
"@
|
|
89
|
+
"@semantic-release/github": "^12.0.0",
|
|
90
|
+
"@semantic-release/npm": "^13.0.0",
|
|
91
|
+
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
92
|
+
"@sindresorhus/is": "^7.1.0",
|
|
93
|
+
"@types/node": "^24.8.1",
|
|
94
|
+
"@types/react": "^19.2.2",
|
|
84
95
|
"@vitest/coverage-v8": "^3.2.4",
|
|
85
96
|
"@vitest/ui": "^3.2.4",
|
|
86
97
|
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
87
|
-
"cspell": "^9.2.
|
|
88
|
-
"eslint": "^9.
|
|
89
|
-
"eslint-
|
|
90
|
-
"eslint-plugin-array-func": "5.0.2",
|
|
91
|
-
"eslint-plugin-functional": "9.0.2",
|
|
92
|
-
"eslint-plugin-import": "2.32.0",
|
|
93
|
-
"eslint-plugin-prefer-arrow-functions": "3.6.2",
|
|
94
|
-
"eslint-plugin-promise": "7.2.1",
|
|
95
|
-
"eslint-plugin-security": "3.0.1",
|
|
96
|
-
"eslint-plugin-unicorn": "60.0.0",
|
|
97
|
-
"eslint-plugin-vitest": "0.5.4",
|
|
98
|
+
"cspell": "^9.2.1",
|
|
99
|
+
"eslint": "^9.38.0",
|
|
100
|
+
"eslint-config-typed": "^1.7.1",
|
|
98
101
|
"fast-glob": "^3.3.3",
|
|
99
|
-
"immer": "^10.1.
|
|
102
|
+
"immer": "^10.1.3",
|
|
103
|
+
"markdownlint": "^0.39.0",
|
|
100
104
|
"markdownlint-cli2": "^0.18.1",
|
|
105
|
+
"npm-run-all2": "^8.0.4",
|
|
106
|
+
"octokit-safe-types": "^1.1.1",
|
|
101
107
|
"prettier": "^3.6.2",
|
|
102
|
-
"prettier-plugin-organize-imports": "^4.
|
|
108
|
+
"prettier-plugin-organize-imports": "^4.3.0",
|
|
103
109
|
"prettier-plugin-packagejson": "^2.5.19",
|
|
104
|
-
"rollup": "^4.
|
|
105
|
-
"semantic-release": "^
|
|
106
|
-
"ts-
|
|
110
|
+
"rollup": "^4.52.4",
|
|
111
|
+
"semantic-release": "^25.0.0",
|
|
112
|
+
"ts-fortress": "^5.2.0",
|
|
113
|
+
"ts-repo-utils": "^7.7.2",
|
|
107
114
|
"tslib": "^2.8.1",
|
|
108
|
-
"tsx": "^4.20.
|
|
109
|
-
"typedoc": "^0.28.
|
|
110
|
-
"typedoc-
|
|
111
|
-
"typescript": "^5.9.
|
|
112
|
-
"
|
|
115
|
+
"tsx": "^4.20.6",
|
|
116
|
+
"typedoc": "^0.28.14",
|
|
117
|
+
"typedoc-github-theme": "^0.3.1",
|
|
118
|
+
"typescript": "^5.9.3",
|
|
119
|
+
"vite": "^7.1.10",
|
|
113
120
|
"vitest": "^3.2.4"
|
|
114
121
|
},
|
|
115
122
|
"peerDependencies": {
|
|
116
123
|
"typescript": ">=4.8"
|
|
117
|
-
},
|
|
118
|
-
"engines": {
|
|
119
|
-
"node": ">=20.11.0"
|
|
120
124
|
}
|
|
121
125
|
}
|