ts-data-forge 5.0.1 → 5.1.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 +101 -50
- package/dist/array/impl/array-utils-creation.d.mts +14 -0
- package/dist/array/impl/array-utils-creation.d.mts.map +1 -1
- package/dist/array/impl/array-utils-creation.mjs +12 -0
- package/dist/array/impl/array-utils-creation.mjs.map +1 -1
- package/dist/array/impl/array-utils-element-access.d.mts +10 -0
- package/dist/array/impl/array-utils-element-access.d.mts.map +1 -1
- package/dist/array/impl/array-utils-element-access.mjs +6 -0
- package/dist/array/impl/array-utils-element-access.mjs.map +1 -1
- package/dist/array/impl/array-utils-modification.d.mts +14 -0
- package/dist/array/impl/array-utils-modification.d.mts.map +1 -1
- package/dist/array/impl/array-utils-modification.mjs.map +1 -1
- package/dist/array/impl/array-utils-reducing-value.d.mts +34 -10
- package/dist/array/impl/array-utils-reducing-value.d.mts.map +1 -1
- package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -1
- package/dist/array/impl/array-utils-search.d.mts +34 -4
- package/dist/array/impl/array-utils-search.d.mts.map +1 -1
- package/dist/array/impl/array-utils-search.mjs.map +1 -1
- package/dist/array/impl/array-utils-set-op.d.mts +20 -7
- package/dist/array/impl/array-utils-set-op.d.mts.map +1 -1
- package/dist/array/impl/array-utils-set-op.mjs +20 -7
- package/dist/array/impl/array-utils-set-op.mjs.map +1 -1
- package/dist/array/impl/array-utils-size.d.mts +5 -2
- package/dist/array/impl/array-utils-size.d.mts.map +1 -1
- package/dist/array/impl/array-utils-size.mjs +5 -2
- package/dist/array/impl/array-utils-size.mjs.map +1 -1
- package/dist/array/impl/array-utils-slice-clamped.d.mts +2 -0
- package/dist/array/impl/array-utils-slice-clamped.d.mts.map +1 -1
- package/dist/array/impl/array-utils-slice-clamped.mjs.map +1 -1
- package/dist/array/impl/array-utils-slicing.d.mts +17 -2
- package/dist/array/impl/array-utils-slicing.d.mts.map +1 -1
- package/dist/array/impl/array-utils-slicing.mjs +9 -2
- package/dist/array/impl/array-utils-slicing.mjs.map +1 -1
- package/dist/array/impl/array-utils-transformation.d.mts +27 -0
- package/dist/array/impl/array-utils-transformation.d.mts.map +1 -1
- package/dist/array/impl/array-utils-transformation.mjs +6 -0
- package/dist/array/impl/array-utils-transformation.mjs.map +1 -1
- package/dist/array/impl/array-utils-validation.d.mts +35 -18
- package/dist/array/impl/array-utils-validation.d.mts.map +1 -1
- package/dist/array/impl/array-utils-validation.mjs +25 -14
- package/dist/array/impl/array-utils-validation.mjs.map +1 -1
- package/dist/collections/imap-mapped.mjs.map +1 -1
- package/dist/collections/imap.d.mts +35 -15
- package/dist/collections/imap.d.mts.map +1 -1
- package/dist/collections/imap.mjs +5 -3
- package/dist/collections/imap.mjs.map +1 -1
- package/dist/collections/iset-mapped.d.mts +46 -19
- package/dist/collections/iset-mapped.d.mts.map +1 -1
- package/dist/collections/iset-mapped.mjs +9 -2
- package/dist/collections/iset-mapped.mjs.map +1 -1
- package/dist/collections/iset.d.mts +48 -19
- package/dist/collections/iset.d.mts.map +1 -1
- package/dist/collections/iset.mjs +9 -2
- package/dist/collections/iset.mjs.map +1 -1
- package/dist/collections/queue.d.mts +65 -25
- package/dist/collections/queue.d.mts.map +1 -1
- package/dist/collections/queue.mjs +13 -5
- package/dist/collections/queue.mjs.map +1 -1
- package/dist/collections/stack.d.mts +60 -25
- package/dist/collections/stack.d.mts.map +1 -1
- package/dist/collections/stack.mjs +12 -5
- package/dist/collections/stack.mjs.map +1 -1
- package/dist/entry-point.mjs +1 -1
- package/dist/functional/match.d.mts +1 -1
- package/dist/functional/match.d.mts.map +1 -1
- package/dist/functional/match.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-expect-to-be.d.mts +3 -2
- package/dist/functional/optional/impl/optional-expect-to-be.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-filter.d.mts +3 -0
- package/dist/functional/optional/impl/optional-filter.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-filter.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-flat-map.d.mts +2 -0
- package/dist/functional/optional/impl/optional-flat-map.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-flat-map.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-from-nullable.d.mts +2 -0
- package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-from-nullable.mjs +2 -0
- package/dist/functional/optional/impl/optional-from-nullable.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-is-none.d.mts +1 -1
- package/dist/functional/optional/impl/optional-is-none.mjs +1 -1
- package/dist/functional/optional/impl/optional-is-optional.d.mts +4 -2
- package/dist/functional/optional/impl/optional-is-optional.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-is-optional.mjs +4 -2
- package/dist/functional/optional/impl/optional-is-optional.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-is-some.d.mts +2 -1
- package/dist/functional/optional/impl/optional-is-some.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-is-some.mjs +2 -1
- package/dist/functional/optional/impl/optional-is-some.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-map.d.mts +2 -0
- package/dist/functional/optional/impl/optional-map.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-map.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-none.d.mts +4 -2
- package/dist/functional/optional/impl/optional-none.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-none.mjs +4 -2
- package/dist/functional/optional/impl/optional-none.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-or-else.d.mts +4 -0
- package/dist/functional/optional/impl/optional-or-else.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-or-else.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-some.d.mts +5 -3
- package/dist/functional/optional/impl/optional-some.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-some.mjs +4 -2
- package/dist/functional/optional/impl/optional-some.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-to-nullable.d.mts +4 -2
- package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-to-nullable.mjs +4 -2
- package/dist/functional/optional/impl/optional-to-nullable.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap-or.d.mts +7 -4
- package/dist/functional/optional/impl/optional-unwrap-or.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap-or.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap-throw.d.mts +2 -1
- package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap-throw.mjs +2 -1
- package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap.d.mts +4 -2
- package/dist/functional/optional/impl/optional-unwrap.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-zip.d.mts +3 -1
- package/dist/functional/optional/impl/optional-zip.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-zip.mjs +3 -1
- package/dist/functional/optional/impl/optional-zip.mjs.map +1 -1
- package/dist/functional/pipe.d.mts +2 -2
- package/dist/functional/result/impl/result-err.d.mts +4 -2
- package/dist/functional/result/impl/result-err.d.mts.map +1 -1
- package/dist/functional/result/impl/result-err.mjs +3 -1
- package/dist/functional/result/impl/result-err.mjs.map +1 -1
- package/dist/functional/result/impl/result-expect-to-be.d.mts +3 -2
- package/dist/functional/result/impl/result-expect-to-be.d.mts.map +1 -1
- package/dist/functional/result/impl/result-expect-to-be.mjs.map +1 -1
- package/dist/functional/result/impl/result-flat-map.d.mts +5 -0
- package/dist/functional/result/impl/result-flat-map.d.mts.map +1 -1
- package/dist/functional/result/impl/result-flat-map.mjs.map +1 -1
- package/dist/functional/result/impl/result-fold.d.mts +4 -0
- package/dist/functional/result/impl/result-fold.d.mts.map +1 -1
- package/dist/functional/result/impl/result-fold.mjs.map +1 -1
- package/dist/functional/result/impl/result-from-promise.d.mts +4 -1
- package/dist/functional/result/impl/result-from-promise.d.mts.map +1 -1
- package/dist/functional/result/impl/result-from-promise.mjs +4 -1
- package/dist/functional/result/impl/result-from-promise.mjs.map +1 -1
- package/dist/functional/result/impl/result-from-throwable.d.mts +3 -1
- package/dist/functional/result/impl/result-from-throwable.d.mts.map +1 -1
- package/dist/functional/result/impl/result-from-throwable.mjs +3 -1
- package/dist/functional/result/impl/result-from-throwable.mjs.map +1 -1
- package/dist/functional/result/impl/result-is-err.d.mts +4 -2
- package/dist/functional/result/impl/result-is-err.d.mts.map +1 -1
- package/dist/functional/result/impl/result-is-err.mjs +4 -2
- package/dist/functional/result/impl/result-is-err.mjs.map +1 -1
- package/dist/functional/result/impl/result-is-ok.d.mts +4 -2
- package/dist/functional/result/impl/result-is-ok.d.mts.map +1 -1
- package/dist/functional/result/impl/result-is-ok.mjs +4 -2
- package/dist/functional/result/impl/result-is-ok.mjs.map +1 -1
- package/dist/functional/result/impl/result-is-result.d.mts +7 -3
- package/dist/functional/result/impl/result-is-result.d.mts.map +1 -1
- package/dist/functional/result/impl/result-is-result.mjs +7 -3
- package/dist/functional/result/impl/result-is-result.mjs.map +1 -1
- package/dist/functional/result/impl/result-map-err.d.mts +3 -0
- package/dist/functional/result/impl/result-map-err.d.mts.map +1 -1
- package/dist/functional/result/impl/result-map-err.mjs.map +1 -1
- package/dist/functional/result/impl/result-map.d.mts +4 -0
- package/dist/functional/result/impl/result-map.d.mts.map +1 -1
- package/dist/functional/result/impl/result-map.mjs.map +1 -1
- package/dist/functional/result/impl/result-ok.d.mts +4 -2
- package/dist/functional/result/impl/result-ok.d.mts.map +1 -1
- package/dist/functional/result/impl/result-ok.mjs +3 -1
- package/dist/functional/result/impl/result-ok.mjs.map +1 -1
- package/dist/functional/result/impl/result-or-else.d.mts +4 -0
- package/dist/functional/result/impl/result-or-else.d.mts.map +1 -1
- package/dist/functional/result/impl/result-or-else.mjs.map +1 -1
- package/dist/functional/result/impl/result-swap.d.mts +2 -0
- package/dist/functional/result/impl/result-swap.d.mts.map +1 -1
- package/dist/functional/result/impl/result-swap.mjs +2 -0
- package/dist/functional/result/impl/result-swap.mjs.map +1 -1
- package/dist/functional/result/impl/result-to-optional.d.mts +2 -0
- package/dist/functional/result/impl/result-to-optional.d.mts.map +1 -1
- package/dist/functional/result/impl/result-to-optional.mjs +2 -0
- package/dist/functional/result/impl/result-to-optional.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err-or.d.mts +7 -4
- package/dist/functional/result/impl/result-unwrap-err-or.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err-or.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err-throw.d.mts +3 -1
- package/dist/functional/result/impl/result-unwrap-err-throw.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err-throw.mjs +3 -1
- package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err.d.mts +3 -2
- package/dist/functional/result/impl/result-unwrap-err.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err.mjs +3 -2
- package/dist/functional/result/impl/result-unwrap-err.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-ok-or.d.mts +7 -4
- package/dist/functional/result/impl/result-unwrap-ok-or.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-ok-or.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-ok.d.mts +3 -2
- package/dist/functional/result/impl/result-unwrap-ok.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-ok.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-throw.d.mts +3 -1
- package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-throw.mjs +3 -1
- package/dist/functional/result/impl/result-unwrap-throw.mjs.map +1 -1
- package/dist/functional/result/impl/result-zip.d.mts +3 -1
- package/dist/functional/result/impl/result-zip.d.mts.map +1 -1
- package/dist/functional/result/impl/result-zip.mjs +3 -1
- package/dist/functional/result/impl/result-zip.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-err.d.mts +3 -2
- package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-err.mjs +2 -1
- package/dist/functional/ternary-result/impl/ternary-result-err.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts +4 -0
- package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-fold.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts +3 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs +3 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts +3 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs +3 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts +7 -3
- package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +7 -3
- package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts +3 -0
- package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts +3 -0
- package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map.d.mts +6 -0
- package/dist/functional/ternary-result/impl/ternary-result-map.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-ok.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-warn.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts +4 -0
- package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-zip.mjs +4 -0
- package/dist/functional/ternary-result/impl/ternary-result-zip.mjs.map +1 -1
- package/dist/globals.d.mts +12 -1
- package/dist/guard/has-key.d.mts +6 -3
- package/dist/guard/has-key.d.mts.map +1 -1
- package/dist/guard/has-key.mjs +2 -2
- package/dist/guard/index.mjs +1 -1
- package/dist/guard/is-record.d.mts +31 -0
- package/dist/guard/is-record.d.mts.map +1 -1
- package/dist/guard/is-record.mjs +32 -1
- package/dist/guard/is-record.mjs.map +1 -1
- package/dist/guard/is-type.d.mts +3 -0
- package/dist/guard/is-type.d.mts.map +1 -1
- package/dist/guard/is-type.mjs +3 -0
- package/dist/guard/is-type.mjs.map +1 -1
- package/dist/guard/key-is-in.d.mts +3 -2
- package/dist/guard/key-is-in.d.mts.map +1 -1
- package/dist/guard/key-is-in.mjs +3 -2
- package/dist/guard/key-is-in.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/iterator/range.d.mts +4 -0
- package/dist/iterator/range.d.mts.map +1 -1
- package/dist/iterator/range.mjs +1 -0
- package/dist/iterator/range.mjs.map +1 -1
- package/dist/json/json.d.mts +42 -21
- package/dist/json/json.d.mts.map +1 -1
- package/dist/json/json.mjs +42 -21
- package/dist/json/json.mjs.map +1 -1
- package/dist/number/branded-types/int.d.mts +33 -19
- package/dist/number/branded-types/int.d.mts.map +1 -1
- package/dist/number/branded-types/int.mjs +33 -19
- package/dist/number/branded-types/int.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-safe-int.mjs +2 -2
- package/dist/number/branded-types/positive-int.d.mts +34 -20
- package/dist/number/branded-types/positive-int.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int.mjs +34 -20
- package/dist/number/branded-types/positive-int.mjs.map +1 -1
- package/dist/number/branded-types/positive-safe-int.d.mts +47 -26
- package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/positive-safe-int.mjs +48 -27
- package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/safe-int.d.mts +48 -27
- package/dist/number/branded-types/safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/safe-int.mjs +50 -29
- package/dist/number/branded-types/safe-int.mjs.map +1 -1
- package/dist/number/branded-types/safe-uint.mjs +1 -1
- package/dist/number/branded-types/uint.d.mts +31 -19
- package/dist/number/branded-types/uint.d.mts.map +1 -1
- package/dist/number/branded-types/uint.mjs +31 -19
- package/dist/number/branded-types/uint.mjs.map +1 -1
- package/dist/number/num.d.mts +29 -20
- package/dist/number/num.d.mts.map +1 -1
- package/dist/number/num.mjs +24 -17
- package/dist/number/num.mjs.map +1 -1
- package/dist/number/refined-number-utils.d.mts +33 -11
- package/dist/number/refined-number-utils.d.mts.map +1 -1
- package/dist/number/refined-number-utils.mjs +33 -11
- package/dist/number/refined-number-utils.mjs.map +1 -1
- package/dist/object/object.d.mts +12 -3
- package/dist/object/object.d.mts.map +1 -1
- package/dist/object/object.mjs +10 -3
- package/dist/object/object.mjs.map +1 -1
- package/dist/others/map-nullable.mjs.map +1 -1
- package/dist/others/tuple.d.mts +14 -3
- package/dist/others/tuple.d.mts.map +1 -1
- package/dist/others/tuple.mjs +14 -3
- package/dist/others/tuple.mjs.map +1 -1
- package/dist/others/unknown-to-string.d.mts.map +1 -1
- package/dist/others/unknown-to-string.mjs.map +1 -1
- package/dist/promise/promise.d.mts +8 -4
- package/dist/promise/promise.d.mts.map +1 -1
- package/dist/promise/promise.mjs +8 -4
- package/dist/promise/promise.mjs.map +1 -1
- package/package.json +26 -28
- package/src/array/impl/array-utils-creation.mts +20 -0
- package/src/array/impl/array-utils-creation.test.mts +72 -1
- package/src/array/impl/array-utils-element-access.mts +13 -0
- package/src/array/impl/array-utils-element-access.test.mts +36 -15
- package/src/array/impl/array-utils-iterators.test.mts +17 -0
- package/src/array/impl/array-utils-modification.mts +78 -19
- package/src/array/impl/array-utils-modification.test.mts +75 -0
- package/src/array/impl/array-utils-overload-type-error.test.mts +19 -0
- package/src/array/impl/array-utils-reducing-value.mts +61 -16
- package/src/array/impl/array-utils-reducing-value.test.mts +107 -25
- package/src/array/impl/array-utils-search.mts +57 -4
- package/src/array/impl/array-utils-search.test.mts +61 -10
- package/src/array/impl/array-utils-set-op.mts +26 -7
- package/src/array/impl/array-utils-set-op.test.mts +129 -13
- package/src/array/impl/array-utils-size.mts +5 -2
- package/src/array/impl/array-utils-size.test.mts +1 -0
- package/src/array/impl/array-utils-slice-clamped.mts +7 -0
- package/src/array/impl/array-utils-slice-clamped.test.mts +20 -0
- package/src/array/impl/array-utils-slicing.mts +29 -2
- package/src/array/impl/array-utils-slicing.test.mts +57 -0
- package/src/array/impl/array-utils-transformation.mts +58 -0
- package/src/array/impl/array-utils-transformation.test.mts +115 -3
- package/src/array/impl/array-utils-validation.mts +41 -18
- package/src/array/impl/array-utils-validation.test.mts +176 -78
- package/src/array/impl/array.test.mts +18 -6
- package/src/collections/imap-mapped.mts +11 -0
- package/src/collections/imap-mapped.test.mts +86 -18
- package/src/collections/imap.mts +47 -15
- package/src/collections/imap.test.mts +137 -31
- package/src/collections/iset-mapped.mts +54 -19
- package/src/collections/iset-mapped.test.mts +163 -52
- package/src/collections/iset.mts +53 -19
- package/src/collections/iset.test.mts +323 -130
- package/src/collections/queue.mts +78 -25
- package/src/collections/queue.test.mts +65 -35
- package/src/collections/stack.mts +67 -25
- package/src/collections/stack.test.mts +59 -15
- package/src/functional/match.mts +17 -1
- package/src/functional/match.test.mts +2 -0
- package/src/functional/optional/impl/optional-expect-to-be.mts +5 -2
- package/src/functional/optional/impl/optional-filter.mts +6 -0
- package/src/functional/optional/impl/optional-flat-map.mts +4 -0
- package/src/functional/optional/impl/optional-from-nullable.mts +2 -0
- package/src/functional/optional/impl/optional-is-none.mts +1 -1
- package/src/functional/optional/impl/optional-is-optional.mts +4 -2
- package/src/functional/optional/impl/optional-is-some.mts +2 -1
- package/src/functional/optional/impl/optional-map.mts +5 -0
- package/src/functional/optional/impl/optional-none.mts +4 -2
- package/src/functional/optional/impl/optional-or-else.mts +6 -0
- package/src/functional/optional/impl/optional-some.mts +5 -3
- package/src/functional/optional/impl/optional-to-nullable.mts +4 -2
- package/src/functional/optional/impl/optional-unwrap-or.mts +9 -4
- package/src/functional/optional/impl/optional-unwrap-throw.mts +2 -1
- package/src/functional/optional/impl/optional-unwrap.mts +4 -2
- package/src/functional/optional/impl/optional-zip.mts +3 -1
- package/src/functional/optional.test.mts +126 -54
- package/src/functional/pipe.mts +2 -2
- package/src/functional/pipe.test.mts +7 -4
- package/src/functional/result/impl/result-err.mts +4 -2
- package/src/functional/result/impl/result-expect-to-be.mts +5 -2
- package/src/functional/result/impl/result-flat-map.mts +7 -0
- package/src/functional/result/impl/result-fold.mts +6 -0
- package/src/functional/result/impl/result-from-promise.mts +4 -1
- package/src/functional/result/impl/result-from-throwable.mts +5 -1
- package/src/functional/result/impl/result-is-err.mts +4 -2
- package/src/functional/result/impl/result-is-ok.mts +4 -2
- package/src/functional/result/impl/result-is-result.mts +7 -3
- package/src/functional/result/impl/result-map-err.mts +5 -0
- package/src/functional/result/impl/result-map.mts +6 -0
- package/src/functional/result/impl/result-ok.mts +4 -2
- package/src/functional/result/impl/result-or-else.mts +6 -0
- package/src/functional/result/impl/result-swap.mts +2 -0
- package/src/functional/result/impl/result-to-optional.mts +2 -0
- package/src/functional/result/impl/result-unwrap-err-or.mts +9 -4
- package/src/functional/result/impl/result-unwrap-err-throw.mts +3 -1
- package/src/functional/result/impl/result-unwrap-err.mts +3 -2
- package/src/functional/result/impl/result-unwrap-ok-or.mts +9 -4
- package/src/functional/result/impl/result-unwrap-ok.mts +4 -2
- package/src/functional/result/impl/result-unwrap-throw.mts +3 -1
- package/src/functional/result/impl/result-zip.mts +3 -1
- package/src/functional/result.test.mts +182 -152
- package/src/functional/ternary-result/impl/ternary-result-err.mts +3 -2
- package/src/functional/ternary-result/impl/ternary-result-expect-to-be.mts +4 -0
- package/src/functional/ternary-result/impl/ternary-result-flat-map.mts +7 -0
- package/src/functional/ternary-result/impl/ternary-result-fold.mts +5 -0
- package/src/functional/ternary-result/impl/ternary-result-from-promise.mts +3 -1
- package/src/functional/ternary-result/impl/ternary-result-from-throwable.mts +4 -1
- package/src/functional/ternary-result/impl/ternary-result-is-ok.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-is-ternary-result.mts +7 -3
- package/src/functional/ternary-result/impl/ternary-result-is-warn.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-map-err.mts +6 -0
- package/src/functional/ternary-result/impl/ternary-result-map-warn.mts +6 -0
- package/src/functional/ternary-result/impl/ternary-result-map.mts +9 -0
- package/src/functional/ternary-result/impl/ternary-result-ok.mts +1 -1
- package/src/functional/ternary-result/impl/ternary-result-or-else.mts +5 -0
- package/src/functional/ternary-result/impl/ternary-result-to-optional.mts +2 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts +5 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-err.mts +2 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mts +5 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-ok.mts +3 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-throw.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mts +5 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-warn.mts +2 -0
- package/src/functional/ternary-result/impl/ternary-result-warn.mts +4 -1
- package/src/functional/ternary-result/impl/ternary-result-zip.mts +4 -0
- package/src/functional/ternary-result.test.mts +99 -8
- package/src/globals.d.mts +12 -1
- package/src/guard/has-key.mts +8 -5
- package/src/guard/has-key.test.mts +9 -5
- package/src/guard/is-error.test.mts +143 -0
- package/src/guard/is-non-empty-string.test.mts +44 -24
- package/src/guard/is-non-null-object.test.mts +45 -26
- package/src/guard/is-primitive.test.mts +51 -28
- package/src/guard/is-record.mts +34 -0
- package/src/guard/is-record.test.mts +28 -7
- package/src/guard/is-type.mts +3 -0
- package/src/guard/is-type.test.mts +285 -155
- package/src/guard/key-is-in.mts +3 -2
- package/src/guard/key-is-in.test.mts +2 -2
- package/src/iterator/range.mts +9 -0
- package/src/json/json.mts +50 -21
- package/src/json/json.test.mts +224 -176
- package/src/number/branded-types/finite-number.test.mts +51 -11
- package/src/number/branded-types/int.mts +33 -19
- package/src/number/branded-types/int.test.mts +56 -14
- package/src/number/branded-types/int16.test.mts +63 -16
- package/src/number/branded-types/int32.test.mts +63 -16
- package/src/number/branded-types/non-negative-finite-number.test.mts +52 -12
- package/src/number/branded-types/non-negative-int16.test.mts +59 -16
- package/src/number/branded-types/non-negative-int32.test.mts +59 -16
- package/src/number/branded-types/non-zero-finite-number.test.mts +65 -14
- package/src/number/branded-types/non-zero-int.test.mts +72 -19
- package/src/number/branded-types/non-zero-int16.test.mts +60 -16
- package/src/number/branded-types/non-zero-int32.test.mts +60 -16
- package/src/number/branded-types/non-zero-safe-int.mts +2 -2
- package/src/number/branded-types/non-zero-safe-int.test.mts +85 -23
- package/src/number/branded-types/non-zero-uint16.test.mts +53 -16
- package/src/number/branded-types/non-zero-uint32.test.mts +53 -16
- package/src/number/branded-types/positive-finite-number.test.mts +59 -14
- package/src/number/branded-types/positive-int.mts +34 -20
- package/src/number/branded-types/positive-int.test.mts +64 -17
- package/src/number/branded-types/positive-int16.test.mts +50 -15
- package/src/number/branded-types/positive-int32.test.mts +50 -15
- package/src/number/branded-types/positive-safe-int.mts +48 -27
- package/src/number/branded-types/positive-safe-int.test.mts +68 -19
- package/src/number/branded-types/positive-uint16.test.mts +53 -16
- package/src/number/branded-types/positive-uint32.test.mts +53 -16
- package/src/number/branded-types/safe-int.mts +50 -29
- package/src/number/branded-types/safe-int.test.mts +70 -18
- package/src/number/branded-types/safe-uint.mts +1 -1
- package/src/number/branded-types/safe-uint.test.mts +65 -17
- package/src/number/branded-types/uint.mts +31 -19
- package/src/number/branded-types/uint.test.mts +58 -15
- package/src/number/branded-types/uint16.test.mts +56 -15
- package/src/number/branded-types/uint32.test.mts +56 -15
- package/src/number/enum/int8.test.mts +7 -1
- package/src/number/enum/uint8.test.mts +7 -1
- package/src/number/num.mts +32 -21
- package/src/number/num.test.mts +88 -26
- package/src/number/refined-number-utils.mts +38 -13
- package/src/object/object.mts +19 -3
- package/src/object/object.test.mts +16 -6
- package/src/others/cast-mutable.test.mts +8 -1
- package/src/others/cast-readonly.test.mts +21 -4
- package/src/others/if-then.test.mts +40 -24
- package/src/others/map-nullable.mts +3 -0
- package/src/others/map-nullable.test.mts +27 -0
- package/src/others/memoize-function.test.mts +41 -0
- package/src/others/tuple.mts +14 -3
- package/src/others/unknown-to-string.mts +2 -0
- package/src/others/unknown-to-string.test.mts +10 -0
- package/src/promise/promise.mts +8 -4
- package/src/promise/promise.test.mts +8 -13
|
@@ -10,20 +10,27 @@ describe('PositiveSafeInt test', () => {
|
|
|
10
10
|
describe(asPositiveSafeInt, () => {
|
|
11
11
|
test('accepts valid positive safe integers', () => {
|
|
12
12
|
expect(() => asPositiveSafeInt(1)).not.toThrow();
|
|
13
|
+
|
|
13
14
|
expect(() => asPositiveSafeInt(2)).not.toThrow();
|
|
15
|
+
|
|
14
16
|
expect(() => asPositiveSafeInt(42)).not.toThrow();
|
|
17
|
+
|
|
15
18
|
expect(() => asPositiveSafeInt(100)).not.toThrow();
|
|
19
|
+
|
|
16
20
|
expect(() => asPositiveSafeInt(Number.MAX_SAFE_INTEGER)).not.toThrow();
|
|
17
21
|
});
|
|
18
22
|
|
|
19
23
|
test('rejects zero', () => {
|
|
20
24
|
expect(() => asPositiveSafeInt(0)).toThrow(TypeError);
|
|
25
|
+
|
|
21
26
|
expect(() => asPositiveSafeInt(-0)).toThrow(TypeError);
|
|
22
27
|
});
|
|
23
28
|
|
|
24
29
|
test('rejects negative integers', () => {
|
|
25
30
|
expect(() => asPositiveSafeInt(-1)).toThrow(TypeError);
|
|
31
|
+
|
|
26
32
|
expect(() => asPositiveSafeInt(-42)).toThrow(TypeError);
|
|
33
|
+
|
|
27
34
|
expect(() => asPositiveSafeInt(Number.MIN_SAFE_INTEGER)).toThrow(
|
|
28
35
|
TypeError,
|
|
29
36
|
);
|
|
@@ -33,24 +40,31 @@ describe('PositiveSafeInt test', () => {
|
|
|
33
40
|
expect(() => asPositiveSafeInt(Number.MAX_SAFE_INTEGER + 1)).toThrow(
|
|
34
41
|
TypeError,
|
|
35
42
|
);
|
|
43
|
+
|
|
36
44
|
expect(() => asPositiveSafeInt(Number.MAX_VALUE)).toThrow(TypeError);
|
|
37
45
|
});
|
|
38
46
|
|
|
39
47
|
test('rejects non-integers', () => {
|
|
40
48
|
expect(() => asPositiveSafeInt(Number.NaN)).toThrow(TypeError);
|
|
49
|
+
|
|
41
50
|
expect(() => asPositiveSafeInt(Number.POSITIVE_INFINITY)).toThrow(
|
|
42
51
|
TypeError,
|
|
43
52
|
);
|
|
53
|
+
|
|
44
54
|
expect(() => asPositiveSafeInt(Number.NEGATIVE_INFINITY)).toThrow(
|
|
45
55
|
TypeError,
|
|
46
56
|
);
|
|
57
|
+
|
|
47
58
|
expect(() => asPositiveSafeInt(1.2)).toThrow(TypeError);
|
|
59
|
+
|
|
48
60
|
expect(() => asPositiveSafeInt(-3.4)).toThrow(TypeError);
|
|
49
61
|
});
|
|
50
62
|
|
|
51
63
|
test('returns the same value for valid inputs', () => {
|
|
52
64
|
expect(asPositiveSafeInt(5)).toBe(5);
|
|
65
|
+
|
|
53
66
|
expect(asPositiveSafeInt(1)).toBe(1);
|
|
67
|
+
|
|
54
68
|
expect(asPositiveSafeInt(10)).toBe(10);
|
|
55
69
|
});
|
|
56
70
|
|
|
@@ -74,42 +88,56 @@ describe('PositiveSafeInt test', () => {
|
|
|
74
88
|
|
|
75
89
|
describe(isPositiveSafeInt, () => {
|
|
76
90
|
test('correctly identifies positive safe integers', () => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
91
|
+
assert.isTrue(isPositiveSafeInt(1));
|
|
92
|
+
|
|
93
|
+
assert.isTrue(isPositiveSafeInt(2));
|
|
94
|
+
|
|
95
|
+
assert.isTrue(isPositiveSafeInt(42));
|
|
96
|
+
|
|
97
|
+
assert.isTrue(isPositiveSafeInt(100));
|
|
98
|
+
|
|
99
|
+
assert.isTrue(isPositiveSafeInt(Number.MAX_SAFE_INTEGER));
|
|
82
100
|
});
|
|
83
101
|
|
|
84
102
|
test('correctly identifies zero', () => {
|
|
85
|
-
|
|
86
|
-
|
|
103
|
+
assert.isFalse(isPositiveSafeInt(0));
|
|
104
|
+
|
|
105
|
+
assert.isFalse(isPositiveSafeInt(-0));
|
|
87
106
|
});
|
|
88
107
|
|
|
89
108
|
test('correctly identifies negative integers', () => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
109
|
+
assert.isFalse(isPositiveSafeInt(-1));
|
|
110
|
+
|
|
111
|
+
assert.isFalse(isPositiveSafeInt(-42));
|
|
112
|
+
|
|
113
|
+
assert.isFalse(isPositiveSafeInt(Number.MIN_SAFE_INTEGER));
|
|
93
114
|
});
|
|
94
115
|
|
|
95
116
|
test('correctly identifies values outside safe integer range', () => {
|
|
96
|
-
|
|
97
|
-
|
|
117
|
+
assert.isFalse(isPositiveSafeInt(Number.MAX_SAFE_INTEGER + 1));
|
|
118
|
+
|
|
119
|
+
assert.isFalse(isPositiveSafeInt(Number.MAX_VALUE));
|
|
98
120
|
});
|
|
99
121
|
|
|
100
122
|
test('correctly identifies non-integers', () => {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
123
|
+
assert.isFalse(isPositiveSafeInt(Number.NaN));
|
|
124
|
+
|
|
125
|
+
assert.isFalse(isPositiveSafeInt(Number.POSITIVE_INFINITY));
|
|
126
|
+
|
|
127
|
+
assert.isFalse(isPositiveSafeInt(Number.NEGATIVE_INFINITY));
|
|
128
|
+
|
|
129
|
+
assert.isFalse(isPositiveSafeInt(1.2));
|
|
130
|
+
|
|
131
|
+
assert.isFalse(isPositiveSafeInt(-3.4));
|
|
106
132
|
});
|
|
107
133
|
});
|
|
108
134
|
|
|
109
135
|
describe('PositiveSafeInt.is', () => {
|
|
110
136
|
test('same as isPositiveSafeInt function', () => {
|
|
111
137
|
expect(PositiveSafeInt.is(5)).toBe(isPositiveSafeInt(5));
|
|
138
|
+
|
|
112
139
|
expect(PositiveSafeInt.is(0)).toBe(isPositiveSafeInt(0));
|
|
140
|
+
|
|
113
141
|
expect(PositiveSafeInt.is(-10)).toBe(isPositiveSafeInt(-10));
|
|
114
142
|
});
|
|
115
143
|
});
|
|
@@ -117,33 +145,43 @@ describe('PositiveSafeInt test', () => {
|
|
|
117
145
|
describe('constants', () => {
|
|
118
146
|
test('MIN_VALUE and MAX_VALUE', () => {
|
|
119
147
|
expect(PositiveSafeInt.MIN_VALUE).toBe(1);
|
|
148
|
+
|
|
120
149
|
expect(PositiveSafeInt.MAX_VALUE).toBe(Number.MAX_SAFE_INTEGER);
|
|
121
150
|
});
|
|
122
151
|
});
|
|
123
152
|
|
|
124
153
|
describe('mathematical operations', () => {
|
|
125
154
|
const a = asPositiveSafeInt(5);
|
|
155
|
+
|
|
126
156
|
const b = asPositiveSafeInt(2);
|
|
157
|
+
|
|
127
158
|
const c = asPositiveSafeInt(1);
|
|
128
159
|
|
|
129
160
|
test('min and max', () => {
|
|
130
161
|
expect(PositiveSafeInt.min(a, b)).toBe(2);
|
|
162
|
+
|
|
131
163
|
expect(PositiveSafeInt.max(a, b)).toBe(5);
|
|
164
|
+
|
|
132
165
|
expect(PositiveSafeInt.min(a, c)).toBe(1);
|
|
166
|
+
|
|
133
167
|
expect(PositiveSafeInt.max(a, c)).toBe(5);
|
|
134
168
|
});
|
|
135
169
|
|
|
136
170
|
test('add (clamped to positive safe int range)', () => {
|
|
137
171
|
const largeValue = asPositiveSafeInt(Number.MAX_SAFE_INTEGER - 1);
|
|
172
|
+
|
|
138
173
|
const result = PositiveSafeInt.add(largeValue, asPositiveSafeInt(10));
|
|
139
174
|
|
|
140
175
|
expect(result).toBe(Number.MAX_SAFE_INTEGER); // clamped to max
|
|
176
|
+
|
|
141
177
|
expect(PositiveSafeInt.add(a, b)).toBe(7);
|
|
142
178
|
});
|
|
143
179
|
|
|
144
180
|
test('sub (never goes below 1)', () => {
|
|
145
181
|
expect(PositiveSafeInt.sub(a, b)).toBe(3);
|
|
182
|
+
|
|
146
183
|
expect(PositiveSafeInt.sub(b, a)).toBe(1); // clamped to 1
|
|
184
|
+
|
|
147
185
|
expect(PositiveSafeInt.sub(c, a)).toBe(1); // clamped to 1
|
|
148
186
|
});
|
|
149
187
|
|
|
@@ -151,9 +189,11 @@ describe('PositiveSafeInt test', () => {
|
|
|
151
189
|
const largeValue = asPositiveSafeInt(
|
|
152
190
|
Math.floor(Math.sqrt(Number.MAX_SAFE_INTEGER)),
|
|
153
191
|
);
|
|
192
|
+
|
|
154
193
|
const result = PositiveSafeInt.mul(largeValue, largeValue);
|
|
155
194
|
|
|
156
195
|
expect(result).toBeLessThanOrEqual(Number.MAX_SAFE_INTEGER);
|
|
196
|
+
|
|
157
197
|
expect(
|
|
158
198
|
PositiveSafeInt.mul(asPositiveSafeInt(10), asPositiveSafeInt(5)),
|
|
159
199
|
).toBe(50);
|
|
@@ -161,9 +201,11 @@ describe('PositiveSafeInt test', () => {
|
|
|
161
201
|
|
|
162
202
|
test('div (floor division, never goes below 1)', () => {
|
|
163
203
|
expect(PositiveSafeInt.div(a, b)).toBe(2);
|
|
204
|
+
|
|
164
205
|
expect(
|
|
165
206
|
PositiveSafeInt.div(asPositiveSafeInt(7), asPositiveSafeInt(3)),
|
|
166
207
|
).toBe(2);
|
|
208
|
+
|
|
167
209
|
expect(PositiveSafeInt.div(b, a)).toBe(1); // floor(2/5) = 0, but clamped to 1
|
|
168
210
|
});
|
|
169
211
|
|
|
@@ -174,6 +216,7 @@ describe('PositiveSafeInt test', () => {
|
|
|
174
216
|
);
|
|
175
217
|
|
|
176
218
|
expect(result).toBe(Number.MAX_SAFE_INTEGER); // clamped to max
|
|
219
|
+
|
|
177
220
|
expect(
|
|
178
221
|
PositiveSafeInt.pow(asPositiveSafeInt(2), asPositiveSafeInt(3)),
|
|
179
222
|
).toBe(8);
|
|
@@ -183,15 +226,20 @@ describe('PositiveSafeInt test', () => {
|
|
|
183
226
|
describe('random', () => {
|
|
184
227
|
test('generates positive safe integers within specified range', () => {
|
|
185
228
|
const min = 1;
|
|
229
|
+
|
|
186
230
|
const max = 20;
|
|
187
231
|
|
|
188
232
|
for (const _ of range(10)) {
|
|
189
233
|
const result = PositiveSafeInt.random(min, max);
|
|
190
234
|
|
|
191
235
|
expect(result).toBeGreaterThanOrEqual(min);
|
|
236
|
+
|
|
192
237
|
expect(result).toBeLessThanOrEqual(max);
|
|
193
|
-
|
|
194
|
-
|
|
238
|
+
|
|
239
|
+
assert.isTrue(PositiveSafeInt.is(result));
|
|
240
|
+
|
|
241
|
+
assert.isTrue(Number.isInteger(result));
|
|
242
|
+
|
|
195
243
|
expect(result).toBeGreaterThan(0);
|
|
196
244
|
}
|
|
197
245
|
});
|
|
@@ -201,6 +249,7 @@ describe('PositiveSafeInt test', () => {
|
|
|
201
249
|
const result = PositiveSafeInt.random(1, 30);
|
|
202
250
|
|
|
203
251
|
expect(result).toBeGreaterThanOrEqual(1);
|
|
252
|
+
|
|
204
253
|
expect(result).toBeLessThanOrEqual(Number.MAX_SAFE_INTEGER);
|
|
205
254
|
}
|
|
206
255
|
});
|
|
@@ -10,8 +10,11 @@ describe('PositiveUint16 test', () => {
|
|
|
10
10
|
describe(asPositiveUint16, () => {
|
|
11
11
|
test('accepts valid positive uint16 values', () => {
|
|
12
12
|
expect(() => asPositiveUint16(1)).not.toThrow();
|
|
13
|
+
|
|
13
14
|
expect(() => asPositiveUint16(1000)).not.toThrow();
|
|
15
|
+
|
|
14
16
|
expect(() => asPositiveUint16(65_535)).not.toThrow(); // 2^16 - 1
|
|
17
|
+
|
|
15
18
|
expect(() => asPositiveUint16(32_768)).not.toThrow(); // 2^15
|
|
16
19
|
});
|
|
17
20
|
|
|
@@ -21,29 +24,37 @@ describe('PositiveUint16 test', () => {
|
|
|
21
24
|
|
|
22
25
|
test('rejects values outside uint16 range', () => {
|
|
23
26
|
expect(() => asPositiveUint16(65_536)).toThrow(TypeError); // 2^16
|
|
27
|
+
|
|
24
28
|
expect(() => asPositiveUint16(100_000)).toThrow(TypeError);
|
|
25
29
|
});
|
|
26
30
|
|
|
27
31
|
test('rejects negative integers', () => {
|
|
28
32
|
expect(() => asPositiveUint16(-1)).toThrow(TypeError);
|
|
33
|
+
|
|
29
34
|
expect(() => asPositiveUint16(-42)).toThrow(TypeError);
|
|
30
35
|
});
|
|
31
36
|
|
|
32
37
|
test('rejects non-integers', () => {
|
|
33
38
|
expect(() => asPositiveUint16(Number.NaN)).toThrow(TypeError);
|
|
39
|
+
|
|
34
40
|
expect(() => asPositiveUint16(Number.POSITIVE_INFINITY)).toThrow(
|
|
35
41
|
TypeError,
|
|
36
42
|
);
|
|
43
|
+
|
|
37
44
|
expect(() => asPositiveUint16(Number.NEGATIVE_INFINITY)).toThrow(
|
|
38
45
|
TypeError,
|
|
39
46
|
);
|
|
47
|
+
|
|
40
48
|
expect(() => asPositiveUint16(1.2)).toThrow(TypeError);
|
|
49
|
+
|
|
41
50
|
expect(() => asPositiveUint16(-3.4)).toThrow(TypeError);
|
|
42
51
|
});
|
|
43
52
|
|
|
44
53
|
test('returns the same value for valid inputs', () => {
|
|
45
54
|
expect(asPositiveUint16(5)).toBe(5);
|
|
55
|
+
|
|
46
56
|
expect(asPositiveUint16(1)).toBe(1);
|
|
57
|
+
|
|
47
58
|
expect(asPositiveUint16(65_535)).toBe(65_535);
|
|
48
59
|
});
|
|
49
60
|
|
|
@@ -70,39 +81,50 @@ describe('PositiveUint16 test', () => {
|
|
|
70
81
|
|
|
71
82
|
describe(isPositiveUint16, () => {
|
|
72
83
|
test('correctly identifies positive uint16 values', () => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
84
|
+
assert.isTrue(isPositiveUint16(1));
|
|
85
|
+
|
|
86
|
+
assert.isTrue(isPositiveUint16(1000));
|
|
87
|
+
|
|
88
|
+
assert.isTrue(isPositiveUint16(65_535));
|
|
89
|
+
|
|
90
|
+
assert.isTrue(isPositiveUint16(32_768));
|
|
77
91
|
});
|
|
78
92
|
|
|
79
93
|
test('correctly identifies zero', () => {
|
|
80
|
-
|
|
94
|
+
assert.isFalse(isPositiveUint16(0));
|
|
81
95
|
});
|
|
82
96
|
|
|
83
97
|
test('correctly identifies values outside uint16 range', () => {
|
|
84
|
-
|
|
85
|
-
|
|
98
|
+
assert.isFalse(isPositiveUint16(65_536));
|
|
99
|
+
|
|
100
|
+
assert.isFalse(isPositiveUint16(100_000));
|
|
86
101
|
});
|
|
87
102
|
|
|
88
103
|
test('correctly identifies negative integers', () => {
|
|
89
|
-
|
|
90
|
-
|
|
104
|
+
assert.isFalse(isPositiveUint16(-1));
|
|
105
|
+
|
|
106
|
+
assert.isFalse(isPositiveUint16(-42));
|
|
91
107
|
});
|
|
92
108
|
|
|
93
109
|
test('correctly identifies non-integers', () => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
110
|
+
assert.isFalse(isPositiveUint16(Number.NaN));
|
|
111
|
+
|
|
112
|
+
assert.isFalse(isPositiveUint16(Number.POSITIVE_INFINITY));
|
|
113
|
+
|
|
114
|
+
assert.isFalse(isPositiveUint16(Number.NEGATIVE_INFINITY));
|
|
115
|
+
|
|
116
|
+
assert.isFalse(isPositiveUint16(1.2));
|
|
117
|
+
|
|
118
|
+
assert.isFalse(isPositiveUint16(-3.4));
|
|
99
119
|
});
|
|
100
120
|
});
|
|
101
121
|
|
|
102
122
|
describe('PositiveUint16.is', () => {
|
|
103
123
|
test('same as isPositiveUint16 function', () => {
|
|
104
124
|
expect(PositiveUint16.is(5)).toBe(isPositiveUint16(5));
|
|
125
|
+
|
|
105
126
|
expect(PositiveUint16.is(0)).toBe(isPositiveUint16(0));
|
|
127
|
+
|
|
106
128
|
expect(PositiveUint16.is(-1)).toBe(isPositiveUint16(-1));
|
|
107
129
|
});
|
|
108
130
|
});
|
|
@@ -110,16 +132,19 @@ describe('PositiveUint16 test', () => {
|
|
|
110
132
|
describe('constants', () => {
|
|
111
133
|
test('MIN_VALUE and MAX_VALUE', () => {
|
|
112
134
|
expect(PositiveUint16.MIN_VALUE).toBe(1);
|
|
135
|
+
|
|
113
136
|
expect(PositiveUint16.MAX_VALUE).toBe(65_535);
|
|
114
137
|
});
|
|
115
138
|
});
|
|
116
139
|
|
|
117
140
|
describe('mathematical operations', () => {
|
|
118
141
|
const a = asPositiveUint16(100);
|
|
142
|
+
|
|
119
143
|
const b = asPositiveUint16(50);
|
|
120
144
|
|
|
121
145
|
test('min and max', () => {
|
|
122
146
|
expect(PositiveUint16.min(a, b)).toBe(50);
|
|
147
|
+
|
|
123
148
|
expect(PositiveUint16.max(a, b)).toBe(100);
|
|
124
149
|
});
|
|
125
150
|
|
|
@@ -130,11 +155,13 @@ describe('PositiveUint16 test', () => {
|
|
|
130
155
|
);
|
|
131
156
|
|
|
132
157
|
expect(result).toBe(65_535); // clamped to max
|
|
158
|
+
|
|
133
159
|
expect(PositiveUint16.add(a, b)).toBe(150);
|
|
134
160
|
});
|
|
135
161
|
|
|
136
162
|
test('sub (never goes below 1)', () => {
|
|
137
163
|
expect(PositiveUint16.sub(a, b)).toBe(50);
|
|
164
|
+
|
|
138
165
|
expect(PositiveUint16.sub(b, a)).toBe(1); // clamped to 1
|
|
139
166
|
});
|
|
140
167
|
|
|
@@ -145,6 +172,7 @@ describe('PositiveUint16 test', () => {
|
|
|
145
172
|
);
|
|
146
173
|
|
|
147
174
|
expect(result).toBe(65_535); // clamped to max
|
|
175
|
+
|
|
148
176
|
expect(
|
|
149
177
|
PositiveUint16.mul(asPositiveUint16(10), asPositiveUint16(5)),
|
|
150
178
|
).toBe(50);
|
|
@@ -152,9 +180,11 @@ describe('PositiveUint16 test', () => {
|
|
|
152
180
|
|
|
153
181
|
test('div (floor division, never goes below 1)', () => {
|
|
154
182
|
expect(PositiveUint16.div(a, asPositiveUint16(50))).toBe(2);
|
|
183
|
+
|
|
155
184
|
expect(PositiveUint16.div(asPositiveUint16(7), asPositiveUint16(3))).toBe(
|
|
156
185
|
2,
|
|
157
186
|
);
|
|
187
|
+
|
|
158
188
|
expect(
|
|
159
189
|
PositiveUint16.div(asPositiveUint16(50), asPositiveUint16(100)),
|
|
160
190
|
).toBe(1); // floor(50/100) = 0, clamped to 1
|
|
@@ -167,6 +197,7 @@ describe('PositiveUint16 test', () => {
|
|
|
167
197
|
);
|
|
168
198
|
|
|
169
199
|
expect(result).toBe(65_535); // clamped to max
|
|
200
|
+
|
|
170
201
|
expect(PositiveUint16.pow(asPositiveUint16(2), asPositiveUint16(3))).toBe(
|
|
171
202
|
8,
|
|
172
203
|
);
|
|
@@ -176,15 +207,20 @@ describe('PositiveUint16 test', () => {
|
|
|
176
207
|
describe('random', () => {
|
|
177
208
|
test('generates positive uint16 values within specified range', () => {
|
|
178
209
|
const min = 1;
|
|
210
|
+
|
|
179
211
|
const max = 20;
|
|
180
212
|
|
|
181
213
|
for (const _ of range(10)) {
|
|
182
214
|
const result = PositiveUint16.random(min, max);
|
|
183
215
|
|
|
184
216
|
expect(result).toBeGreaterThanOrEqual(min);
|
|
217
|
+
|
|
185
218
|
expect(result).toBeLessThanOrEqual(max);
|
|
186
|
-
|
|
187
|
-
|
|
219
|
+
|
|
220
|
+
assert.isTrue(PositiveUint16.is(result));
|
|
221
|
+
|
|
222
|
+
assert.isTrue(Number.isInteger(result));
|
|
223
|
+
|
|
188
224
|
expect(result).toBeGreaterThan(0);
|
|
189
225
|
}
|
|
190
226
|
});
|
|
@@ -194,6 +230,7 @@ describe('PositiveUint16 test', () => {
|
|
|
194
230
|
const result = PositiveUint16.random(1, 30);
|
|
195
231
|
|
|
196
232
|
expect(result).toBeGreaterThanOrEqual(1);
|
|
233
|
+
|
|
197
234
|
expect(result).toBeLessThanOrEqual(65_535);
|
|
198
235
|
}
|
|
199
236
|
});
|
|
@@ -10,8 +10,11 @@ describe('PositiveUint32 test', () => {
|
|
|
10
10
|
describe(asPositiveUint32, () => {
|
|
11
11
|
test('accepts valid positive uint32 values', () => {
|
|
12
12
|
expect(() => asPositiveUint32(1)).not.toThrow();
|
|
13
|
+
|
|
13
14
|
expect(() => asPositiveUint32(1000)).not.toThrow();
|
|
15
|
+
|
|
14
16
|
expect(() => asPositiveUint32(4_294_967_295)).not.toThrow(); // 2^32 - 1
|
|
17
|
+
|
|
15
18
|
expect(() => asPositiveUint32(2_147_483_648)).not.toThrow(); // 2^31
|
|
16
19
|
});
|
|
17
20
|
|
|
@@ -21,29 +24,37 @@ describe('PositiveUint32 test', () => {
|
|
|
21
24
|
|
|
22
25
|
test('rejects values outside uint32 range', () => {
|
|
23
26
|
expect(() => asPositiveUint32(4_294_967_296)).toThrow(TypeError); // 2^32
|
|
27
|
+
|
|
24
28
|
expect(() => asPositiveUint32(10_000_000_000)).toThrow(TypeError);
|
|
25
29
|
});
|
|
26
30
|
|
|
27
31
|
test('rejects negative integers', () => {
|
|
28
32
|
expect(() => asPositiveUint32(-1)).toThrow(TypeError);
|
|
33
|
+
|
|
29
34
|
expect(() => asPositiveUint32(-42)).toThrow(TypeError);
|
|
30
35
|
});
|
|
31
36
|
|
|
32
37
|
test('rejects non-integers', () => {
|
|
33
38
|
expect(() => asPositiveUint32(Number.NaN)).toThrow(TypeError);
|
|
39
|
+
|
|
34
40
|
expect(() => asPositiveUint32(Number.POSITIVE_INFINITY)).toThrow(
|
|
35
41
|
TypeError,
|
|
36
42
|
);
|
|
43
|
+
|
|
37
44
|
expect(() => asPositiveUint32(Number.NEGATIVE_INFINITY)).toThrow(
|
|
38
45
|
TypeError,
|
|
39
46
|
);
|
|
47
|
+
|
|
40
48
|
expect(() => asPositiveUint32(1.2)).toThrow(TypeError);
|
|
49
|
+
|
|
41
50
|
expect(() => asPositiveUint32(-3.4)).toThrow(TypeError);
|
|
42
51
|
});
|
|
43
52
|
|
|
44
53
|
test('returns the same value for valid inputs', () => {
|
|
45
54
|
expect(asPositiveUint32(5)).toBe(5);
|
|
55
|
+
|
|
46
56
|
expect(asPositiveUint32(1)).toBe(1);
|
|
57
|
+
|
|
47
58
|
expect(asPositiveUint32(4_294_967_295)).toBe(4_294_967_295);
|
|
48
59
|
});
|
|
49
60
|
|
|
@@ -70,39 +81,50 @@ describe('PositiveUint32 test', () => {
|
|
|
70
81
|
|
|
71
82
|
describe(isPositiveUint32, () => {
|
|
72
83
|
test('correctly identifies positive uint32 values', () => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
84
|
+
assert.isTrue(isPositiveUint32(1));
|
|
85
|
+
|
|
86
|
+
assert.isTrue(isPositiveUint32(1000));
|
|
87
|
+
|
|
88
|
+
assert.isTrue(isPositiveUint32(4_294_967_295));
|
|
89
|
+
|
|
90
|
+
assert.isTrue(isPositiveUint32(2_147_483_648));
|
|
77
91
|
});
|
|
78
92
|
|
|
79
93
|
test('correctly identifies zero', () => {
|
|
80
|
-
|
|
94
|
+
assert.isFalse(isPositiveUint32(0));
|
|
81
95
|
});
|
|
82
96
|
|
|
83
97
|
test('correctly identifies values outside uint32 range', () => {
|
|
84
|
-
|
|
85
|
-
|
|
98
|
+
assert.isFalse(isPositiveUint32(4_294_967_296));
|
|
99
|
+
|
|
100
|
+
assert.isFalse(isPositiveUint32(10_000_000_000));
|
|
86
101
|
});
|
|
87
102
|
|
|
88
103
|
test('correctly identifies negative integers', () => {
|
|
89
|
-
|
|
90
|
-
|
|
104
|
+
assert.isFalse(isPositiveUint32(-1));
|
|
105
|
+
|
|
106
|
+
assert.isFalse(isPositiveUint32(-42));
|
|
91
107
|
});
|
|
92
108
|
|
|
93
109
|
test('correctly identifies non-integers', () => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
110
|
+
assert.isFalse(isPositiveUint32(Number.NaN));
|
|
111
|
+
|
|
112
|
+
assert.isFalse(isPositiveUint32(Number.POSITIVE_INFINITY));
|
|
113
|
+
|
|
114
|
+
assert.isFalse(isPositiveUint32(Number.NEGATIVE_INFINITY));
|
|
115
|
+
|
|
116
|
+
assert.isFalse(isPositiveUint32(1.2));
|
|
117
|
+
|
|
118
|
+
assert.isFalse(isPositiveUint32(-3.4));
|
|
99
119
|
});
|
|
100
120
|
});
|
|
101
121
|
|
|
102
122
|
describe('PositiveUint32.is', () => {
|
|
103
123
|
test('same as isPositiveUint32 function', () => {
|
|
104
124
|
expect(PositiveUint32.is(5)).toBe(isPositiveUint32(5));
|
|
125
|
+
|
|
105
126
|
expect(PositiveUint32.is(0)).toBe(isPositiveUint32(0));
|
|
127
|
+
|
|
106
128
|
expect(PositiveUint32.is(-1)).toBe(isPositiveUint32(-1));
|
|
107
129
|
});
|
|
108
130
|
});
|
|
@@ -110,16 +132,19 @@ describe('PositiveUint32 test', () => {
|
|
|
110
132
|
describe('constants', () => {
|
|
111
133
|
test('MIN_VALUE and MAX_VALUE', () => {
|
|
112
134
|
expect(PositiveUint32.MIN_VALUE).toBe(1);
|
|
135
|
+
|
|
113
136
|
expect(PositiveUint32.MAX_VALUE).toBe(4_294_967_295);
|
|
114
137
|
});
|
|
115
138
|
});
|
|
116
139
|
|
|
117
140
|
describe('mathematical operations', () => {
|
|
118
141
|
const a = asPositiveUint32(1_000_000);
|
|
142
|
+
|
|
119
143
|
const b = asPositiveUint32(500_000);
|
|
120
144
|
|
|
121
145
|
test('min and max', () => {
|
|
122
146
|
expect(PositiveUint32.min(a, b)).toBe(500_000);
|
|
147
|
+
|
|
123
148
|
expect(PositiveUint32.max(a, b)).toBe(1_000_000);
|
|
124
149
|
});
|
|
125
150
|
|
|
@@ -130,11 +155,13 @@ describe('PositiveUint32 test', () => {
|
|
|
130
155
|
);
|
|
131
156
|
|
|
132
157
|
expect(result).toBe(4_294_967_295); // clamped to max
|
|
158
|
+
|
|
133
159
|
expect(PositiveUint32.add(a, b)).toBe(1_500_000);
|
|
134
160
|
});
|
|
135
161
|
|
|
136
162
|
test('sub (never goes below 1)', () => {
|
|
137
163
|
expect(PositiveUint32.sub(a, b)).toBe(500_000);
|
|
164
|
+
|
|
138
165
|
expect(PositiveUint32.sub(b, a)).toBe(1); // clamped to 1
|
|
139
166
|
});
|
|
140
167
|
|
|
@@ -145,6 +172,7 @@ describe('PositiveUint32 test', () => {
|
|
|
145
172
|
);
|
|
146
173
|
|
|
147
174
|
expect(result).toBe(4_294_967_295); // clamped to max
|
|
175
|
+
|
|
148
176
|
expect(
|
|
149
177
|
PositiveUint32.mul(asPositiveUint32(1000), asPositiveUint32(5)),
|
|
150
178
|
).toBe(5000);
|
|
@@ -152,9 +180,11 @@ describe('PositiveUint32 test', () => {
|
|
|
152
180
|
|
|
153
181
|
test('div (floor division, never goes below 1)', () => {
|
|
154
182
|
expect(PositiveUint32.div(a, asPositiveUint32(500_000))).toBe(2);
|
|
183
|
+
|
|
155
184
|
expect(PositiveUint32.div(asPositiveUint32(7), asPositiveUint32(3))).toBe(
|
|
156
185
|
2,
|
|
157
186
|
);
|
|
187
|
+
|
|
158
188
|
expect(
|
|
159
189
|
PositiveUint32.div(
|
|
160
190
|
asPositiveUint32(500_000),
|
|
@@ -170,6 +200,7 @@ describe('PositiveUint32 test', () => {
|
|
|
170
200
|
);
|
|
171
201
|
|
|
172
202
|
expect(result).toBe(4_294_967_295); // clamped to max
|
|
203
|
+
|
|
173
204
|
expect(PositiveUint32.pow(asPositiveUint32(2), asPositiveUint32(3))).toBe(
|
|
174
205
|
8,
|
|
175
206
|
);
|
|
@@ -179,15 +210,20 @@ describe('PositiveUint32 test', () => {
|
|
|
179
210
|
describe('random', () => {
|
|
180
211
|
test('generates positive uint32 values within specified range', () => {
|
|
181
212
|
const min = 1;
|
|
213
|
+
|
|
182
214
|
const max = 20;
|
|
183
215
|
|
|
184
216
|
for (const _ of range(10)) {
|
|
185
217
|
const result = PositiveUint32.random(min, max);
|
|
186
218
|
|
|
187
219
|
expect(result).toBeGreaterThanOrEqual(min);
|
|
220
|
+
|
|
188
221
|
expect(result).toBeLessThanOrEqual(max);
|
|
189
|
-
|
|
190
|
-
|
|
222
|
+
|
|
223
|
+
assert.isTrue(PositiveUint32.is(result));
|
|
224
|
+
|
|
225
|
+
assert.isTrue(Number.isInteger(result));
|
|
226
|
+
|
|
191
227
|
expect(result).toBeGreaterThan(0);
|
|
192
228
|
}
|
|
193
229
|
});
|
|
@@ -197,6 +233,7 @@ describe('PositiveUint32 test', () => {
|
|
|
197
233
|
const result = PositiveUint32.random(1, 30);
|
|
198
234
|
|
|
199
235
|
expect(result).toBeGreaterThanOrEqual(1);
|
|
236
|
+
|
|
200
237
|
expect(result).toBeLessThanOrEqual(4_294_967_295);
|
|
201
238
|
}
|
|
202
239
|
});
|