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
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if two arrays are equal by comparing their elements.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* const numbers = [1, 2, 3] as const;
|
|
8
|
+
* const sameNumbers = [1, 2, 3] as const;
|
|
9
|
+
* const differentNumbers = [1, 2, 4] as const;
|
|
10
|
+
*
|
|
11
|
+
* assert.ok(Arr.eq(numbers, sameNumbers));
|
|
12
|
+
* assert.notOk(Arr.eq(numbers, differentNumbers));
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
const eq = (array1, array2, equality = Object.is) => array1.length === array2.length &&
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
17
|
+
array1.every((v, i) => equality(v, array2[i]));
|
|
18
|
+
/**
|
|
19
|
+
* Alias for `eq`.
|
|
20
|
+
*
|
|
21
|
+
* @see {@link eq}
|
|
22
|
+
*/
|
|
23
|
+
const equal = eq;
|
|
24
|
+
/**
|
|
25
|
+
* Checks if the first array is a subset of the second array.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* const subset = [1, 2] as const;
|
|
31
|
+
* const superset = [1, 2, 3] as const;
|
|
32
|
+
* const notSubset = [2, 4] as const;
|
|
33
|
+
*
|
|
34
|
+
* assert.ok(Arr.isSubset(subset, superset));
|
|
35
|
+
* assert.notOk(Arr.isSubset(notSubset, superset));
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
const isSubset = (array1, array2) => array1.every((a) =>
|
|
39
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
40
|
+
array2.includes(a));
|
|
41
|
+
/**
|
|
42
|
+
* Checks if the first array is a superset of the second array.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
*
|
|
46
|
+
* ```ts
|
|
47
|
+
* const potentialSuperset = ['a', 'b', 'c'] as const;
|
|
48
|
+
* const subset = ['a', 'c'] as const;
|
|
49
|
+
* const notSuperset = ['a', 'd'] as const;
|
|
50
|
+
*
|
|
51
|
+
* assert.ok(Arr.isSuperset(potentialSuperset, subset));
|
|
52
|
+
* assert.notOk(Arr.isSuperset(subset, potentialSuperset));
|
|
53
|
+
* assert.notOk(Arr.isSuperset(potentialSuperset, notSuperset));
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
const isSuperset = (array1, array2) => isSubset(array2, array1);
|
|
57
|
+
/**
|
|
58
|
+
* Returns the intersection of two arrays.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
*
|
|
62
|
+
* ```ts
|
|
63
|
+
* const refs = ['Ada', 'Alan', 'Grace'] as const;
|
|
64
|
+
* const attendees = ['Grace', 'Alan', 'Barbara'] as const;
|
|
65
|
+
*
|
|
66
|
+
* const both = Arr.setIntersection(refs, attendees);
|
|
67
|
+
*
|
|
68
|
+
* assert.deepStrictEqual(both, ['Alan', 'Grace']);
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
const setIntersection = (array1, array2) =>
|
|
72
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
73
|
+
array1.filter((e) => array2.includes(e));
|
|
74
|
+
/**
|
|
75
|
+
* Returns the set difference of two arrays (elements in first but not in second).
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
*
|
|
79
|
+
* ```ts
|
|
80
|
+
* const baseline = [1, 2, 3, 4] as const;
|
|
81
|
+
* const removed = [2, 4] as const;
|
|
82
|
+
*
|
|
83
|
+
* const remaining = Arr.setDifference(baseline, removed);
|
|
84
|
+
*
|
|
85
|
+
* assert.deepStrictEqual(remaining, [1, 3]);
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
const setDifference = (array1, array2) => array1.filter((e) => !array2.includes(e));
|
|
89
|
+
/**
|
|
90
|
+
* Returns the set difference of two sorted numeric arrays (optimized for sorted arrays).
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
*
|
|
94
|
+
* ```ts
|
|
95
|
+
* const upcoming = [1, 3, 5, 7, 9] as const;
|
|
96
|
+
* const completed = [3, 4, 7] as const;
|
|
97
|
+
*
|
|
98
|
+
* const remaining = Arr.sortedNumSetDifference(upcoming, completed);
|
|
99
|
+
*
|
|
100
|
+
* const expected = [1, 5, 9] as const;
|
|
101
|
+
*
|
|
102
|
+
* assert.deepStrictEqual(remaining, expected);
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
const sortedNumSetDifference = (sortedList1, sortedList2) => {
|
|
106
|
+
const mut_result = [];
|
|
107
|
+
let mut_it1 = 0; // iterator for sortedList1
|
|
108
|
+
let mut_it2 = 0; // iterator for sortedList2
|
|
109
|
+
while (mut_it1 < sortedList1.length && mut_it2 < sortedList2.length) {
|
|
110
|
+
// Non-null assertions are safe due to loop condition
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
112
|
+
const val1 = sortedList1[mut_it1];
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
114
|
+
const val2 = sortedList2[mut_it2];
|
|
115
|
+
if (val1 === val2) {
|
|
116
|
+
mut_it1 += 1;
|
|
117
|
+
mut_it2 += 1;
|
|
118
|
+
}
|
|
119
|
+
else if (val1 < val2) {
|
|
120
|
+
mut_result.push(val1);
|
|
121
|
+
mut_it1 += 1;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
// val1 > val2
|
|
125
|
+
mut_it2 += 1;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// Add remaining elements from sortedList1
|
|
129
|
+
for (; mut_it1 < sortedList1.length; mut_it1 += 1) {
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
131
|
+
mut_result.push(sortedList1[mut_it1]);
|
|
132
|
+
}
|
|
133
|
+
return mut_result;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export { eq, equal, isSubset, isSuperset, setDifference, setIntersection, sortedNumSetDifference };
|
|
137
|
+
//# sourceMappingURL=array-utils-set-op.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-utils-set-op.mjs","sources":["../../../src/array/impl/array-utils-set-op.mts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;AAaG;MACU,EAAE,GAAG,CAChB,MAAoB,EACpB,MAAoB,EACpB,QAAA,GAAoC,MAAM,CAAC,EAAE,KAE7C,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM;;IAE/B,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAE,CAAC;AAEhD;;;;AAIG;AACI,MAAM,KAAK,GAAG;AAErB;;;;;;;;;;;;;AAaG;AACI,MAAM,QAAQ,GAAG,CACtB,MAAqB,EACrB,MAAqB,KAErB,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACb;AACA,MAAM,CAAC,QAAQ,CAAC,CAAY,CAAC;AAGjC;;;;;;;;;;;;;;AAcG;AACI,MAAM,UAAU,GAAG,CACxB,MAAqB,EACrB,MAAqB,KACT,QAAQ,CAAC,MAAM,EAAE,MAAM;AAErC;;;;;;;;;;;;;AAaG;MACU,eAAe,GAAG,CAI7B,MAAqB,EACrB,MAAqB;AAErB;AACA,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAY,CAAC;AAEpD;;;;;;;;;;;;;AAaG;AACI,MAAM,aAAa,GAAG,CAC3B,MAAoB,EACpB,MAAoB,KACH,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AAE3D;;;;;;;;;;;;;;;AAeG;MACU,sBAAsB,GAAG,CACpC,WAAyB,EACzB,WAAyB,KACT;IAChB,MAAM,UAAU,GAAQ,EAAE;AAC1B,IAAA,IAAI,OAAO,GAAG,CAAC,CAAC;AAChB,IAAA,IAAI,OAAO,GAAG,CAAC,CAAC;AAEhB,IAAA,OAAO,OAAO,GAAG,WAAW,CAAC,MAAM,IAAI,OAAO,GAAG,WAAW,CAAC,MAAM,EAAE;;;AAGnE,QAAA,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAE;;AAElC,QAAA,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAE;AAElC,QAAA,IAAI,IAAI,KAAK,IAAI,EAAE;YACjB,OAAO,IAAI,CAAC;YACZ,OAAO,IAAI,CAAC;QACd;AAAO,aAAA,IAAI,IAAI,GAAG,IAAI,EAAE;AACtB,YAAA,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;YACrB,OAAO,IAAI,CAAC;QACd;aAAO;;YAEL,OAAO,IAAI,CAAC;QACd;IACF;;IAEA,OAAO,OAAO,GAAG,WAAW,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,EAAE;;QAEjD,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAE,CAAC;IACxC;AAEA,IAAA,OAAO,UAAU;AACnB;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the size (length) of an array.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* const numbers = [1, 2, 3] as const;
|
|
8
|
+
* const letters: string[] = [];
|
|
9
|
+
*
|
|
10
|
+
* const sizeOfNumbers = Arr.size(numbers);
|
|
11
|
+
* const sizeOfLetters = Arr.size(letters);
|
|
12
|
+
*
|
|
13
|
+
* assert(sizeOfNumbers === 3);
|
|
14
|
+
* assert(sizeOfLetters === 0);
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const size: <const Ar extends readonly unknown[]>(array: Ar) => Ar extends NonEmptyArray<unknown> ? IntersectBrand<PositiveNumber, SizeType.Arr> : SizeType.Arr;
|
|
18
|
+
/**
|
|
19
|
+
* Alias for `size`.
|
|
20
|
+
*
|
|
21
|
+
* @see {@link size}
|
|
22
|
+
*/
|
|
23
|
+
export declare const length: <const Ar extends readonly unknown[]>(array: Ar) => Ar extends NonEmptyArray<unknown> ? IntersectBrand<PositiveNumber, SizeType.Arr> : SizeType.Arr;
|
|
24
|
+
//# sourceMappingURL=array-utils-size.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-utils-size.d.mts","sourceRoot":"","sources":["../../../src/array/impl/array-utils-size.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,IAAI,GAAI,KAAK,CAAC,EAAE,SAAS,SAAS,OAAO,EAAE,EACtD,OAAO,EAAE,KACR,EAAE,SAAS,aAAa,CAAC,OAAO,CAAC,GAChC,cAAc,CAAC,cAAc,EAAE,QAAQ,CAAC,GAAG,CAAC,GAC5C,QAAQ,CAAC,GAEU,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,MAAM,SAbQ,EAAE,SAAS,SAAS,OAAO,EAAE,SAC/C,EAAE,KACR,EAAE,SAAS,aAAa,CAAC,OAAO,CAAC,GAChC,cAAc,CAAC,cAAc,EAAE,QAAQ,CAAC,GAAG,CAAC,GAC5C,QAAQ,CAAC,GASa,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the size (length) of an array.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* const numbers = [1, 2, 3] as const;
|
|
8
|
+
* const letters: string[] = [];
|
|
9
|
+
*
|
|
10
|
+
* const sizeOfNumbers = Arr.size(numbers);
|
|
11
|
+
* const sizeOfLetters = Arr.size(letters);
|
|
12
|
+
*
|
|
13
|
+
* assert(sizeOfNumbers === 3);
|
|
14
|
+
* assert(sizeOfLetters === 0);
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
const size = (array) =>
|
|
18
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
19
|
+
array.length;
|
|
20
|
+
/**
|
|
21
|
+
* Alias for `size`.
|
|
22
|
+
*
|
|
23
|
+
* @see {@link size}
|
|
24
|
+
*/
|
|
25
|
+
const length = size;
|
|
26
|
+
|
|
27
|
+
export { length, size };
|
|
28
|
+
//# sourceMappingURL=array-utils-size.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-utils-size.mjs","sources":["../../../src/array/impl/array-utils-size.mts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,IAAI,GAAG,CAClB,KAAS;AAIT;AACA,KAAK,CAAC;AAER;;;;AAIG;AACI,MAAM,MAAM,GAAG;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slices an array with automatically clamped start and end indices.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* const letters = ['a', 'b', 'c', 'd', 'e'];
|
|
8
|
+
*
|
|
9
|
+
* const lastThree = Arr.sliceClamped(letters, -3, 10);
|
|
10
|
+
* const middleTwo = Arr.sliceClamped(1, 3)(letters);
|
|
11
|
+
*
|
|
12
|
+
* assert.deepStrictEqual(lastThree, ['a', 'b', 'c', 'd', 'e']);
|
|
13
|
+
* assert.deepStrictEqual(middleTwo, ['b', 'c']);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function sliceClamped<const Ar extends readonly unknown[]>(array: Ar, start: ArgArrayIndexWithNegative<Ar>, end: ArgArrayIndexWithNegative<Ar>): readonly Ar[number][];
|
|
17
|
+
export declare function sliceClamped(start: SizeType.ArgArrWithNegative, end: SizeType.ArgArrWithNegative): <E>(array: readonly E[]) => readonly E[];
|
|
18
|
+
//# sourceMappingURL=array-utils-slice-clamped.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-utils-slice-clamped.d.mts","sourceRoot":"","sources":["../../../src/array/impl/array-utils-slice-clamped.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,SAAS,SAAS,OAAO,EAAE,EAC9D,KAAK,EAAE,EAAE,EACT,KAAK,EAAE,yBAAyB,CAAC,EAAE,CAAC,EACpC,GAAG,EAAE,yBAAyB,CAAC,EAAE,CAAC,GACjC,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;AAEzB,wBAAgB,YAAY,CAC1B,KAAK,EAAE,QAAQ,CAAC,kBAAkB,EAClC,GAAG,EAAE,QAAQ,CAAC,kBAAkB,GAC/B,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,SAAS,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import '../../number/branded-types/finite-number.mjs';
|
|
2
|
+
import '../../number/branded-types/int.mjs';
|
|
3
|
+
import '../../number/branded-types/int16.mjs';
|
|
4
|
+
import '../../number/branded-types/int32.mjs';
|
|
5
|
+
import '../../number/branded-types/non-negative-finite-number.mjs';
|
|
6
|
+
import '../../number/branded-types/non-negative-int16.mjs';
|
|
7
|
+
import '../../number/branded-types/non-negative-int32.mjs';
|
|
8
|
+
import '../../number/branded-types/non-zero-finite-number.mjs';
|
|
9
|
+
import '../../number/branded-types/non-zero-int.mjs';
|
|
10
|
+
import '../../number/branded-types/non-zero-int16.mjs';
|
|
11
|
+
import '../../number/branded-types/non-zero-int32.mjs';
|
|
12
|
+
import '../../number/branded-types/non-zero-safe-int.mjs';
|
|
13
|
+
import '../../number/branded-types/non-zero-uint16.mjs';
|
|
14
|
+
import '../../number/branded-types/non-zero-uint32.mjs';
|
|
15
|
+
import '../../number/branded-types/positive-finite-number.mjs';
|
|
16
|
+
import '../../number/branded-types/positive-int.mjs';
|
|
17
|
+
import '../../number/branded-types/positive-int16.mjs';
|
|
18
|
+
import '../../number/branded-types/positive-int32.mjs';
|
|
19
|
+
import '../../number/branded-types/positive-safe-int.mjs';
|
|
20
|
+
import '../../number/branded-types/positive-uint16.mjs';
|
|
21
|
+
import '../../number/branded-types/positive-uint32.mjs';
|
|
22
|
+
import '../../number/branded-types/safe-int.mjs';
|
|
23
|
+
import '../../number/branded-types/safe-uint.mjs';
|
|
24
|
+
import '../../number/branded-types/uint.mjs';
|
|
25
|
+
import '../../number/branded-types/uint16.mjs';
|
|
26
|
+
import '../../number/branded-types/uint32.mjs';
|
|
27
|
+
import '../../number/enum/int8.mjs';
|
|
28
|
+
import '../../number/enum/uint8.mjs';
|
|
29
|
+
import { Num } from '../../number/num.mjs';
|
|
30
|
+
import '../../number/refined-number-utils.mjs';
|
|
31
|
+
|
|
32
|
+
function sliceClamped(...args) {
|
|
33
|
+
switch (args.length) {
|
|
34
|
+
case 3: {
|
|
35
|
+
const [array, start, end] = args;
|
|
36
|
+
const startClamped = Num.clamp(0, array.length)(start);
|
|
37
|
+
// Ensure endClamped is not less than startClamped.
|
|
38
|
+
const endClamped = Num.clamp(startClamped, array.length)(end);
|
|
39
|
+
return array.slice(startClamped, endClamped);
|
|
40
|
+
}
|
|
41
|
+
case 2: {
|
|
42
|
+
const [start, end] = args;
|
|
43
|
+
return (array) => sliceClamped(array, start, end);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { sliceClamped };
|
|
49
|
+
//# sourceMappingURL=array-utils-slice-clamped.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-utils-slice-clamped.mjs","sources":["../../../src/array/impl/array-utils-slice-clamped.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BM,SAAU,YAAY,CAC1B,GAAG,IAMoE,EAAA;AAEvE,IAAA,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,CAAC,EAAE;YACN,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,GAAG,IAAI;AAChC,YAAA,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC;;AAEtD,YAAA,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC;YAC7D,OAAO,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,UAAU,CAAC;QAC9C;QACA,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,IAAI;AACzB,YAAA,OAAO,CAAC,KAAK,KAAK,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC;QACnD;;AAEJ;;;;"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns all elements of an array except the first one.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* {
|
|
8
|
+
* const scientists = ['Ada', 'Grace', 'Katherine'] as const;
|
|
9
|
+
* const remainder = Arr.tail(scientists);
|
|
10
|
+
*
|
|
11
|
+
* assert.deepStrictEqual(remainder, ['Grace', 'Katherine']);
|
|
12
|
+
* assert(remainder.length === 2);
|
|
13
|
+
* }
|
|
14
|
+
* {
|
|
15
|
+
* const values = [1, 2, 3] as const;
|
|
16
|
+
*
|
|
17
|
+
* const remainder = Arr.rest(values);
|
|
18
|
+
* const emptyRemainder = Arr.rest([1] as const);
|
|
19
|
+
*
|
|
20
|
+
* assert.deepStrictEqual(remainder, [2, 3] as const);
|
|
21
|
+
* assert.deepStrictEqual(emptyRemainder, [] as const);
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const tail: <const Ar extends readonly unknown[]>(array: Ar) => List.Tail<Ar>;
|
|
26
|
+
/**
|
|
27
|
+
* Returns all elements of an array except the last one.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
*
|
|
31
|
+
* ```ts
|
|
32
|
+
* const queue = ['task-1', 'task-2', 'task-3'] as const;
|
|
33
|
+
* const withoutLast = Arr.butLast(queue);
|
|
34
|
+
*
|
|
35
|
+
* assert.deepStrictEqual(withoutLast, ['task-1', 'task-2']);
|
|
36
|
+
* assert(withoutLast.length === 2);
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare const butLast: <const Ar extends readonly unknown[]>(array: Ar) => List.ButLast<Ar>;
|
|
40
|
+
/**
|
|
41
|
+
* Takes the first N elements from an array.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
*
|
|
45
|
+
* ```ts
|
|
46
|
+
* const values = [1, 2, 3, 4];
|
|
47
|
+
*
|
|
48
|
+
* const firstTwo = Arr.take(values, 2);
|
|
49
|
+
* const firstThree = Arr.take(3)(values);
|
|
50
|
+
*
|
|
51
|
+
* assert.deepStrictEqual(firstTwo, [1, 2]);
|
|
52
|
+
* assert.deepStrictEqual(firstThree, [1, 2, 3]);
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function take<const Ar extends readonly unknown[], N extends SizeType.ArgArr>(array: Ar, num: N): N extends SmallUint ? List.Take<N, Ar> : N extends SizeType.ArgArrPositive ? Ar extends NonEmptyArray<unknown> ? NonEmptyArray<Ar[number]> : readonly Ar[number][] : readonly Ar[number][];
|
|
56
|
+
export declare function take<N extends SizeType.ArgArr>(num: N): <const Ar extends readonly unknown[]>(array: Ar) => N extends SmallUint ? List.Take<N, Ar> : N extends SizeType.ArgArrPositive ? Ar extends NonEmptyArray<unknown> ? NonEmptyArray<Ar[number]> : readonly Ar[number][] : readonly Ar[number][];
|
|
57
|
+
/**
|
|
58
|
+
* Takes the last N elements from an array.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
*
|
|
62
|
+
* ```ts
|
|
63
|
+
* const values = [1, 2, 3, 4];
|
|
64
|
+
*
|
|
65
|
+
* const lastTwo = Arr.takeLast(values, 2);
|
|
66
|
+
* const lastThree = Arr.takeLast(3)(values);
|
|
67
|
+
*
|
|
68
|
+
* assert.deepStrictEqual(lastTwo, [3, 4]);
|
|
69
|
+
* assert.deepStrictEqual(lastThree, [2, 3, 4]);
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare function takeLast<const Ar extends readonly unknown[], N extends SizeType.ArgArr>(array: Ar, num: N): N extends SmallUint ? List.TakeLast<N, Ar> : N extends SizeType.ArgArrPositive ? Ar extends NonEmptyArray<unknown> ? NonEmptyArray<Ar[number]> : readonly Ar[number][] : readonly Ar[number][];
|
|
73
|
+
export declare function takeLast<N extends SizeType.ArgArr>(num: N): <const Ar extends readonly unknown[]>(array: Ar) => N extends SmallUint ? List.TakeLast<N, Ar> : N extends SizeType.ArgArrPositive ? Ar extends NonEmptyArray<unknown> ? NonEmptyArray<Ar[number]> : readonly Ar[number][] : readonly Ar[number][];
|
|
74
|
+
/**
|
|
75
|
+
* Skips the first N elements of an array.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
*
|
|
79
|
+
* ```ts
|
|
80
|
+
* const values = ['a', 'b', 'c', 'd'] as const;
|
|
81
|
+
*
|
|
82
|
+
* const withoutFirstTwo = Arr.skip(values, 2);
|
|
83
|
+
* const withoutFirstThree = Arr.skip(3)(values);
|
|
84
|
+
*
|
|
85
|
+
* assert.deepStrictEqual(withoutFirstTwo, ['c', 'd']);
|
|
86
|
+
* assert.deepStrictEqual(withoutFirstThree, ['d']);
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export declare function skip<const Ar extends readonly unknown[], N extends SizeType.ArgArr>(array: Ar, num: N): N extends SmallUint ? List.Skip<N, Ar> : readonly Ar[number][];
|
|
90
|
+
export declare function skip<N extends SizeType.ArgArr>(num: N): <const Ar extends readonly unknown[]>(array: Ar) => N extends SmallUint ? List.Skip<N, Ar> : readonly Ar[number][];
|
|
91
|
+
/**
|
|
92
|
+
* Skips the last N elements of an array.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
*
|
|
96
|
+
* ```ts
|
|
97
|
+
* const values = ['a', 'b', 'c', 'd'];
|
|
98
|
+
*
|
|
99
|
+
* const withoutLastTwo = Arr.skipLast(values, 2);
|
|
100
|
+
* const withoutLastThree = Arr.skipLast(3)(values);
|
|
101
|
+
*
|
|
102
|
+
* assert.deepStrictEqual(withoutLastTwo, ['a', 'b']);
|
|
103
|
+
* assert.deepStrictEqual(withoutLastThree, ['a']);
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare function skipLast<const Ar extends readonly unknown[], N extends SizeType.ArgArr>(array: Ar, num: N): N extends SmallUint ? List.SkipLast<N, Ar> : readonly Ar[number][];
|
|
107
|
+
export declare function skipLast<N extends SizeType.ArgArr>(num: N): <const Ar extends readonly unknown[]>(array: Ar) => N extends SmallUint ? List.SkipLast<N, Ar> : readonly Ar[number][];
|
|
108
|
+
/**
|
|
109
|
+
* Alias for `tail`.
|
|
110
|
+
*
|
|
111
|
+
* @see {@link tail}
|
|
112
|
+
*/
|
|
113
|
+
export declare const rest: <const Ar extends readonly unknown[]>(array: Ar) => List.Tail<Ar>;
|
|
114
|
+
/**
|
|
115
|
+
* Alias for `skip`.
|
|
116
|
+
*
|
|
117
|
+
* @see {@link skip}
|
|
118
|
+
*/
|
|
119
|
+
export declare const drop: typeof skip;
|
|
120
|
+
//# sourceMappingURL=array-utils-slicing.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-utils-slicing.d.mts","sourceR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import '../../number/branded-types/finite-number.mjs';
|
|
2
|
+
import '../../number/branded-types/int.mjs';
|
|
3
|
+
import '../../number/branded-types/int16.mjs';
|
|
4
|
+
import '../../number/branded-types/int32.mjs';
|
|
5
|
+
import '../../number/branded-types/non-negative-finite-number.mjs';
|
|
6
|
+
import '../../number/branded-types/non-negative-int16.mjs';
|
|
7
|
+
import '../../number/branded-types/non-negative-int32.mjs';
|
|
8
|
+
import '../../number/branded-types/non-zero-finite-number.mjs';
|
|
9
|
+
import '../../number/branded-types/non-zero-int.mjs';
|
|
10
|
+
import '../../number/branded-types/non-zero-int16.mjs';
|
|
11
|
+
import '../../number/branded-types/non-zero-int32.mjs';
|
|
12
|
+
import '../../number/branded-types/non-zero-safe-int.mjs';
|
|
13
|
+
import '../../number/branded-types/non-zero-uint16.mjs';
|
|
14
|
+
import '../../number/branded-types/non-zero-uint32.mjs';
|
|
15
|
+
import '../../number/branded-types/positive-finite-number.mjs';
|
|
16
|
+
import '../../number/branded-types/positive-int.mjs';
|
|
17
|
+
import '../../number/branded-types/positive-int16.mjs';
|
|
18
|
+
import '../../number/branded-types/positive-int32.mjs';
|
|
19
|
+
import '../../number/branded-types/positive-safe-int.mjs';
|
|
20
|
+
import '../../number/branded-types/positive-uint16.mjs';
|
|
21
|
+
import '../../number/branded-types/positive-uint32.mjs';
|
|
22
|
+
import '../../number/branded-types/safe-int.mjs';
|
|
23
|
+
import '../../number/branded-types/safe-uint.mjs';
|
|
24
|
+
import '../../number/branded-types/uint.mjs';
|
|
25
|
+
import '../../number/branded-types/uint16.mjs';
|
|
26
|
+
import { Uint32 } from '../../number/branded-types/uint32.mjs';
|
|
27
|
+
import '../../number/enum/int8.mjs';
|
|
28
|
+
import '../../number/enum/uint8.mjs';
|
|
29
|
+
import '../../number/num.mjs';
|
|
30
|
+
import '../../number/refined-number-utils.mjs';
|
|
31
|
+
import { size } from './array-utils-size.mjs';
|
|
32
|
+
import { sliceClamped } from './array-utils-slice-clamped.mjs';
|
|
33
|
+
import { isEmpty } from './array-utils-validation.mjs';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Returns all elements of an array except the first one.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
*
|
|
40
|
+
* ```ts
|
|
41
|
+
* {
|
|
42
|
+
* const scientists = ['Ada', 'Grace', 'Katherine'] as const;
|
|
43
|
+
* const remainder = Arr.tail(scientists);
|
|
44
|
+
*
|
|
45
|
+
* assert.deepStrictEqual(remainder, ['Grace', 'Katherine']);
|
|
46
|
+
* assert(remainder.length === 2);
|
|
47
|
+
* }
|
|
48
|
+
* {
|
|
49
|
+
* const values = [1, 2, 3] as const;
|
|
50
|
+
*
|
|
51
|
+
* const remainder = Arr.rest(values);
|
|
52
|
+
* const emptyRemainder = Arr.rest([1] as const);
|
|
53
|
+
*
|
|
54
|
+
* assert.deepStrictEqual(remainder, [2, 3] as const);
|
|
55
|
+
* assert.deepStrictEqual(emptyRemainder, [] as const);
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
const tail = (array) =>
|
|
60
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
61
|
+
array.slice(1);
|
|
62
|
+
/**
|
|
63
|
+
* Returns all elements of an array except the last one.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
*
|
|
67
|
+
* ```ts
|
|
68
|
+
* const queue = ['task-1', 'task-2', 'task-3'] as const;
|
|
69
|
+
* const withoutLast = Arr.butLast(queue);
|
|
70
|
+
*
|
|
71
|
+
* assert.deepStrictEqual(withoutLast, ['task-1', 'task-2']);
|
|
72
|
+
* assert(withoutLast.length === 2);
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
const butLast = (array) =>
|
|
76
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
77
|
+
(isEmpty(array) ? [] : array.slice(0, -1));
|
|
78
|
+
function take(...args) {
|
|
79
|
+
switch (args.length) {
|
|
80
|
+
case 2: {
|
|
81
|
+
const [array, num] = args;
|
|
82
|
+
return sliceClamped(array, 0, num);
|
|
83
|
+
}
|
|
84
|
+
case 1: {
|
|
85
|
+
const [num] = args;
|
|
86
|
+
return (array) => take(array, num);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function takeLast(...args) {
|
|
91
|
+
switch (args.length) {
|
|
92
|
+
case 2: {
|
|
93
|
+
const [array, num] = args;
|
|
94
|
+
return sliceClamped(array, Uint32.sub(size(array), num), size(array));
|
|
95
|
+
}
|
|
96
|
+
case 1: {
|
|
97
|
+
const [num] = args;
|
|
98
|
+
return (array) => takeLast(array, num);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function skip(...args) {
|
|
103
|
+
switch (args.length) {
|
|
104
|
+
case 2: {
|
|
105
|
+
const [array, num] = args;
|
|
106
|
+
return sliceClamped(array, num, size(array));
|
|
107
|
+
}
|
|
108
|
+
case 1: {
|
|
109
|
+
const [num] = args;
|
|
110
|
+
return (array) => skip(array, num);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function skipLast(...args) {
|
|
115
|
+
switch (args.length) {
|
|
116
|
+
case 2: {
|
|
117
|
+
const [array, num] = args;
|
|
118
|
+
return sliceClamped(array, 0, Uint32.sub(size(array), num));
|
|
119
|
+
}
|
|
120
|
+
case 1: {
|
|
121
|
+
const [num] = args;
|
|
122
|
+
return (array) => skipLast(array, num);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Alias for `tail`.
|
|
128
|
+
*
|
|
129
|
+
* @see {@link tail}
|
|
130
|
+
*/
|
|
131
|
+
const rest = tail;
|
|
132
|
+
/**
|
|
133
|
+
* Alias for `skip`.
|
|
134
|
+
*
|
|
135
|
+
* @see {@link skip}
|
|
136
|
+
*/
|
|
137
|
+
const drop = skip;
|
|
138
|
+
|
|
139
|
+
export { butLast, drop, rest, skip, skipLast, tail, take, takeLast };
|
|
140
|
+
//# sourceMappingURL=array-utils-slicing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-utils-slicing.mjs","sources":["../../../src/array/impl/array-utils-slicing.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACI,MAAM,IAAI,GAAG,CAClB,KAAS;AAET;AACA,KAAK,CAAC,KAAK,CAAC,CAAC;AAEf;;;;;;;;;;;;AAYG;AACI,MAAM,OAAO,GAAG,CACrB,KAAS;AAET;AACA,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;AA2CrC,SAAU,IAAI,CAClB,GAAG,IAEgC,EAAA;AAEnC,IAAA,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,IAAI;YACzB,OAAO,YAAY,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC;QACpC;QACA,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI;YAClB,OAAO,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC;QACpC;;AAEJ;AA2CM,SAAU,QAAQ,CACtB,GAAG,IAEgC,EAAA;AAEnC,IAAA,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,IAAI;YACzB,OAAO,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACvE;QACA,KAAK,CAAC,E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