ts-data-forge 6.9.2 → 6.9.3
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/dist/array/impl/array-utils-creation.d.mts +2 -0
- package/dist/array/impl/array-utils-creation.d.mts.map +1 -1
- package/dist/array/impl/array-utils-creation.mjs.map +1 -1
- package/dist/array/impl/array-utils-element-access.d.mts +3 -0
- package/dist/array/impl/array-utils-element-access.d.mts.map +1 -1
- package/dist/array/impl/array-utils-element-access.mjs.map +1 -1
- package/dist/array/impl/array-utils-iterators.d.mts +1 -0
- package/dist/array/impl/array-utils-iterators.d.mts.map +1 -1
- package/dist/array/impl/array-utils-iterators.mjs.map +1 -1
- package/dist/array/impl/array-utils-modification.d.mts +2 -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 +3 -0
- 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 +2 -0
- 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 +1 -0
- package/dist/array/impl/array-utils-set-op.d.mts.map +1 -1
- package/dist/array/impl/array-utils-set-op.mjs.map +1 -1
- package/dist/array/impl/array-utils-size.d.mts +2 -0
- package/dist/array/impl/array-utils-size.d.mts.map +1 -1
- package/dist/array/impl/array-utils-size.mjs +0 -19
- package/dist/array/impl/array-utils-size.mjs.map +1 -1
- package/dist/array/impl/array-utils-slice-clamped.d.mts +1 -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 +2 -0
- package/dist/array/impl/array-utils-slicing.d.mts.map +1 -1
- package/dist/array/impl/array-utils-slicing.mjs.map +1 -1
- package/dist/array/impl/array-utils-transformation.d.mts +2 -0
- package/dist/array/impl/array-utils-transformation.d.mts.map +1 -1
- package/dist/array/impl/array-utils-transformation.mjs.map +1 -1
- package/dist/array/impl/array-utils-validation.d.mts +2 -0
- package/dist/array/impl/array-utils-validation.d.mts.map +1 -1
- package/dist/array/impl/array-utils-validation.mjs.map +1 -1
- package/dist/collections/imap-mapped.d.mts +2 -0
- package/dist/collections/imap-mapped.d.mts.map +1 -1
- package/dist/collections/imap-mapped.mjs.map +1 -1
- package/dist/collections/imap.d.mts +3 -0
- package/dist/collections/imap.d.mts.map +1 -1
- package/dist/collections/imap.mjs.map +1 -1
- package/dist/collections/iset-mapped.d.mts +2 -0
- package/dist/collections/iset-mapped.d.mts.map +1 -1
- package/dist/collections/iset-mapped.mjs.map +1 -1
- package/dist/collections/iset.d.mts +2 -0
- package/dist/collections/iset.d.mts.map +1 -1
- package/dist/collections/iset.mjs +0 -1
- package/dist/collections/iset.mjs.map +1 -1
- package/dist/collections/queue.d.mts +2 -0
- package/dist/collections/queue.d.mts.map +1 -1
- package/dist/collections/queue.mjs.map +1 -1
- package/dist/collections/stack.d.mts +2 -0
- package/dist/collections/stack.d.mts.map +1 -1
- package/dist/collections/stack.mjs.map +1 -1
- package/dist/expect-type.d.mts +1 -0
- package/dist/expect-type.d.mts.map +1 -1
- package/dist/expect-type.mjs.map +1 -1
- package/dist/functional/match.d.mts +1 -0
- 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 +1 -0
- 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 +1 -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 +1 -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 +1 -0
- package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-from-nullable.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-is-none.d.mts +1 -0
- package/dist/functional/optional/impl/optional-is-none.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-is-none.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-is-optional.d.mts +1 -0
- package/dist/functional/optional/impl/optional-is-optional.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-is-optional.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-is-some.d.mts +1 -0
- package/dist/functional/optional/impl/optional-is-some.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-is-some.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-map.d.mts +1 -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 +1 -0
- package/dist/functional/optional/impl/optional-none.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-none.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-or-else.d.mts +1 -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 +1 -0
- package/dist/functional/optional/impl/optional-some.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-some.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-to-nullable.d.mts +1 -0
- package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-to-nullable.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap-or.d.mts +1 -0
- 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 +1 -0
- package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap.d.mts +2 -0
- 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 +2 -0
- package/dist/functional/optional/impl/optional-zip.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-zip.mjs +1 -0
- package/dist/functional/optional/impl/optional-zip.mjs.map +1 -1
- package/dist/functional/optional/impl/tag.d.mts +1 -0
- package/dist/functional/optional/impl/tag.d.mts.map +1 -1
- package/dist/functional/optional/impl/tag.mjs +0 -1
- package/dist/functional/optional/impl/tag.mjs.map +1 -1
- package/dist/functional/optional/impl/types.d.mts +2 -0
- package/dist/functional/optional/impl/types.d.mts.map +1 -1
- package/dist/functional/optional/index.d.mts +1 -1
- package/dist/functional/optional/index.d.mts.map +1 -1
- package/dist/functional/optional/optional.d.mts +16 -0
- package/dist/functional/optional/optional.d.mts.map +1 -0
- package/dist/functional/optional/optional.mjs +3 -0
- package/dist/functional/optional/optional.mjs.map +1 -0
- package/dist/functional/pipe.d.mts +2 -1
- package/dist/functional/pipe.d.mts.map +1 -1
- package/dist/functional/pipe.mjs.map +1 -1
- package/dist/functional/result/impl/result-err.d.mts +1 -0
- package/dist/functional/result/impl/result-err.d.mts.map +1 -1
- package/dist/functional/result/impl/result-err.mjs.map +1 -1
- package/dist/functional/result/impl/result-expect-to-be.d.mts +1 -0
- 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 +1 -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 +1 -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 +1 -0
- package/dist/functional/result/impl/result-from-promise.d.mts.map +1 -1
- package/dist/functional/result/impl/result-from-promise.mjs.map +1 -1
- package/dist/functional/result/impl/result-from-throwable.d.mts +1 -0
- package/dist/functional/result/impl/result-from-throwable.d.mts.map +1 -1
- package/dist/functional/result/impl/result-from-throwable.mjs.map +1 -1
- package/dist/functional/result/impl/result-is-err.d.mts +1 -0
- package/dist/functional/result/impl/result-is-err.d.mts.map +1 -1
- package/dist/functional/result/impl/result-is-err.mjs.map +1 -1
- package/dist/functional/result/impl/result-is-ok.d.mts +1 -0
- package/dist/functional/result/impl/result-is-ok.d.mts.map +1 -1
- package/dist/functional/result/impl/result-is-ok.mjs.map +1 -1
- package/dist/functional/result/impl/result-is-result.d.mts +1 -0
- package/dist/functional/result/impl/result-is-result.d.mts.map +1 -1
- package/dist/functional/result/impl/result-is-result.mjs.map +1 -1
- package/dist/functional/result/impl/result-map-err.d.mts +1 -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 +1 -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 +1 -0
- package/dist/functional/result/impl/result-ok.d.mts.map +1 -1
- package/dist/functional/result/impl/result-ok.mjs.map +1 -1
- package/dist/functional/result/impl/result-or-else.d.mts +1 -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 +1 -0
- package/dist/functional/result/impl/result-swap.d.mts.map +1 -1
- 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.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err-or.d.mts +1 -0
- 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 +1 -0
- package/dist/functional/result/impl/result-unwrap-err-throw.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err.d.mts +1 -0
- package/dist/functional/result/impl/result-unwrap-err.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-ok-or.d.mts +1 -0
- 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 +2 -0
- 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 +1 -0
- package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-throw.mjs.map +1 -1
- package/dist/functional/result/impl/result-zip.d.mts +1 -0
- package/dist/functional/result/impl/result-zip.d.mts.map +1 -1
- package/dist/functional/result/impl/result-zip.mjs.map +1 -1
- package/dist/functional/result/impl/tag.d.mts +1 -0
- package/dist/functional/result/impl/tag.d.mts.map +1 -1
- package/dist/functional/result/impl/tag.mjs +0 -1
- package/dist/functional/result/impl/tag.mjs.map +1 -1
- package/dist/functional/result/impl/types.d.mts +2 -0
- package/dist/functional/result/impl/types.d.mts.map +1 -1
- package/dist/functional/result/index.d.mts +1 -1
- package/dist/functional/result/index.d.mts.map +1 -1
- package/dist/functional/result/result.d.mts +16 -0
- package/dist/functional/result/result.d.mts.map +1 -0
- package/dist/functional/result/result.mjs +3 -0
- package/dist/functional/result/result.mjs.map +1 -0
- package/dist/functional/ternary-result/impl/tag.d.mts +1 -0
- package/dist/functional/ternary-result/impl/tag.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/tag.mjs +0 -1
- package/dist/functional/ternary-result/impl/tag.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-err.d.mts +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +1 -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 +1 -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 +1 -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 +1 -0
- 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.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts +1 -0
- 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.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-err.d.mts +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-is-err.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-err.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.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts +1 -0
- 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.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.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts +1 -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 +1 -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 +1 -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 -0
- 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 +1 -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.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts +1 -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.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts +1 -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.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts +1 -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 +1 -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.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts +1 -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.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts +1 -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.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts +1 -0
- 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 +1 -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.map +1 -1
- package/dist/functional/ternary-result/impl/types.d.mts +1 -0
- package/dist/functional/ternary-result/impl/types.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/variant-name.d.mts +1 -0
- package/dist/functional/ternary-result/impl/variant-name.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/variant-name.mjs.map +1 -1
- package/dist/functional/ternary-result/index.d.mts +1 -1
- package/dist/functional/ternary-result/index.d.mts.map +1 -1
- package/dist/functional/ternary-result/ternary-result.d.mts +40 -0
- package/dist/functional/ternary-result/ternary-result.d.mts.map +1 -0
- package/dist/functional/ternary-result/ternary-result.mjs +3 -0
- package/dist/functional/ternary-result/ternary-result.mjs.map +1 -0
- package/dist/guard/has-key.d.mts +1 -0
- package/dist/guard/has-key.d.mts.map +1 -1
- package/dist/guard/has-key.mjs.map +1 -1
- package/dist/guard/is-non-empty-string.d.mts +1 -0
- package/dist/guard/is-non-empty-string.d.mts.map +1 -1
- package/dist/guard/is-non-empty-string.mjs.map +1 -1
- package/dist/guard/is-primitive.d.mts +1 -0
- package/dist/guard/is-primitive.d.mts.map +1 -1
- package/dist/guard/is-primitive.mjs.map +1 -1
- package/dist/guard/is-record.d.mts +1 -0
- package/dist/guard/is-record.d.mts.map +1 -1
- package/dist/guard/is-record.mjs.map +1 -1
- package/dist/guard/is-type.d.mts +1 -0
- package/dist/guard/is-type.d.mts.map +1 -1
- package/dist/guard/is-type.mjs.map +1 -1
- package/dist/guard/key-is-in.d.mts +1 -0
- package/dist/guard/key-is-in.d.mts.map +1 -1
- package/dist/guard/key-is-in.mjs.map +1 -1
- package/dist/iterator/range.d.mts +2 -0
- package/dist/iterator/range.d.mts.map +1 -1
- package/dist/iterator/range.mjs.map +1 -1
- package/dist/json/json.d.mts +2 -0
- package/dist/json/json.d.mts.map +1 -1
- package/dist/json/json.mjs.map +1 -1
- package/dist/number/branded-types/finite-number.d.mts +15 -13
- package/dist/number/branded-types/finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/finite-number.mjs.map +1 -1
- package/dist/number/branded-types/int.d.mts +15 -13
- package/dist/number/branded-types/int.d.mts.map +1 -1
- package/dist/number/branded-types/int.mjs.map +1 -1
- package/dist/number/branded-types/int16.d.mts +19 -17
- package/dist/number/branded-types/int16.d.mts.map +1 -1
- package/dist/number/branded-types/int16.mjs.map +1 -1
- package/dist/number/branded-types/int32.d.mts +19 -17
- package/dist/number/branded-types/int32.d.mts.map +1 -1
- package/dist/number/branded-types/int32.mjs.map +1 -1
- package/dist/number/branded-types/non-negative-finite-number.d.mts +16 -14
- package/dist/number/branded-types/non-negative-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/non-negative-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/non-negative-int16.d.mts +18 -16
- package/dist/number/branded-types/non-negative-int16.d.mts.map +1 -1
- package/dist/number/branded-types/non-negative-int16.mjs.map +1 -1
- package/dist/number/branded-types/non-negative-int32.d.mts +18 -16
- package/dist/number/branded-types/non-negative-int32.d.mts.map +1 -1
- package/dist/number/branded-types/non-negative-int32.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-finite-number.d.mts +16 -14
- package/dist/number/branded-types/non-zero-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-int.d.mts +16 -14
- package/dist/number/branded-types/non-zero-int.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-int.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-int16.d.mts +19 -17
- package/dist/number/branded-types/non-zero-int16.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-int16.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-int32.d.mts +19 -17
- package/dist/number/branded-types/non-zero-int32.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-int32.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-safe-int.d.mts +17 -15
- package/dist/number/branded-types/non-zero-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-uint16.d.mts +18 -16
- package/dist/number/branded-types/non-zero-uint16.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-uint16.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-uint32.d.mts +18 -16
- package/dist/number/branded-types/non-zero-uint32.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-uint32.mjs.map +1 -1
- package/dist/number/branded-types/positive-finite-number.d.mts +16 -14
- package/dist/number/branded-types/positive-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/positive-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/positive-int.d.mts +18 -16
- package/dist/number/branded-types/positive-int.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int.mjs.map +1 -1
- package/dist/number/branded-types/positive-int16.d.mts +18 -16
- package/dist/number/branded-types/positive-int16.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int16.mjs.map +1 -1
- package/dist/number/branded-types/positive-int32.d.mts +18 -16
- package/dist/number/branded-types/positive-int32.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int32.mjs.map +1 -1
- package/dist/number/branded-types/positive-safe-int.d.mts +18 -16
- package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/positive-uint16.d.mts +18 -16
- package/dist/number/branded-types/positive-uint16.d.mts.map +1 -1
- package/dist/number/branded-types/positive-uint16.mjs.map +1 -1
- package/dist/number/branded-types/positive-uint32.d.mts +18 -16
- package/dist/number/branded-types/positive-uint32.d.mts.map +1 -1
- package/dist/number/branded-types/positive-uint32.mjs.map +1 -1
- package/dist/number/branded-types/safe-int.d.mts +17 -15
- package/dist/number/branded-types/safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/safe-int.mjs.map +1 -1
- package/dist/number/branded-types/safe-uint.d.mts +19 -17
- package/dist/number/branded-types/safe-uint.d.mts.map +1 -1
- package/dist/number/branded-types/safe-uint.mjs.map +1 -1
- package/dist/number/branded-types/uint.d.mts +18 -16
- package/dist/number/branded-types/uint.d.mts.map +1 -1
- package/dist/number/branded-types/uint.mjs.map +1 -1
- package/dist/number/branded-types/uint16.d.mts +18 -16
- package/dist/number/branded-types/uint16.d.mts.map +1 -1
- package/dist/number/branded-types/uint16.mjs.map +1 -1
- package/dist/number/branded-types/uint32.d.mts +18 -16
- package/dist/number/branded-types/uint32.d.mts.map +1 -1
- package/dist/number/branded-types/uint32.mjs.map +1 -1
- package/dist/number/enum/int8.d.mts +2 -0
- package/dist/number/enum/int8.d.mts.map +1 -1
- package/dist/number/enum/int8.mjs.map +1 -1
- package/dist/number/enum/uint8.d.mts +2 -0
- package/dist/number/enum/uint8.d.mts.map +1 -1
- package/dist/number/enum/uint8.mjs.map +1 -1
- package/dist/number/num.d.mts +2 -0
- package/dist/number/num.d.mts.map +1 -1
- package/dist/number/num.mjs.map +1 -1
- package/dist/number/refined-number-utils.d.mts +1 -0
- package/dist/number/refined-number-utils.d.mts.map +1 -1
- package/dist/number/refined-number-utils.mjs.map +1 -1
- package/dist/object/object.d.mts +1 -0
- package/dist/object/object.d.mts.map +1 -1
- package/dist/object/object.mjs.map +1 -1
- package/dist/others/cast-mutable.d.mts +1 -0
- package/dist/others/cast-mutable.d.mts.map +1 -1
- package/dist/others/cast-mutable.mjs +3 -1
- package/dist/others/cast-mutable.mjs.map +1 -1
- package/dist/others/cast-readonly.d.mts +1 -0
- package/dist/others/cast-readonly.d.mts.map +1 -1
- package/dist/others/cast-readonly.mjs +3 -1
- package/dist/others/cast-readonly.mjs.map +1 -1
- package/dist/others/memoize-function.d.mts +1 -0
- package/dist/others/memoize-function.d.mts.map +1 -1
- package/dist/others/memoize-function.mjs.map +1 -1
- package/dist/promise/promise.d.mts +1 -0
- package/dist/promise/promise.d.mts.map +1 -1
- package/dist/types.d.mts +1 -2
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +2 -0
- package/dist/types.mjs.map +1 -0
- package/package.json +15 -15
- package/src/array/impl/array-utils-creation.mts +19 -0
- package/src/array/impl/array-utils-creation.test.mts +2 -0
- package/src/array/impl/array-utils-element-access.mts +7 -0
- package/src/array/impl/array-utils-element-access.test.mts +2 -0
- package/src/array/impl/array-utils-iterators.mts +1 -0
- package/src/array/impl/array-utils-iterators.test.mts +1 -0
- package/src/array/impl/array-utils-modification.mts +11 -0
- package/src/array/impl/array-utils-modification.test.mts +1 -0
- package/src/array/impl/array-utils-overload-type-error.test.mts +1 -0
- package/src/array/impl/array-utils-reducing-value.mts +7 -0
- package/src/array/impl/array-utils-reducing-value.test.mts +2 -0
- package/src/array/impl/array-utils-search.mts +5 -0
- package/src/array/impl/array-utils-search.test.mts +1 -0
- package/src/array/impl/array-utils-set-op.mts +2 -0
- package/src/array/impl/array-utils-size.mts +7 -0
- package/src/array/impl/array-utils-slice-clamped.mts +1 -0
- package/src/array/impl/array-utils-slicing.mts +2 -0
- package/src/array/impl/array-utils-transformation.mts +17 -0
- package/src/array/impl/array-utils-transformation.test.mts +1 -0
- package/src/array/impl/array-utils-validation.mts +8 -0
- package/src/array/impl/array-utils-validation.test.mts +1 -0
- package/src/collections/imap-mapped.mts +1 -0
- package/src/collections/imap-mapped.test.mts +1 -0
- package/src/collections/imap.mts +2 -0
- package/src/collections/iset-mapped.mts +2 -0
- package/src/collections/iset.mts +2 -1
- package/src/collections/iset.test.mts +4 -2
- package/src/collections/queue.mts +1 -0
- package/src/collections/stack.mts +1 -0
- package/src/collections/stack.test.mts +1 -0
- package/src/expect-type.mts +2 -0
- package/src/functional/match.mts +7 -0
- package/src/functional/match.test.mts +1 -0
- package/src/functional/optional/impl/optional-expect-to-be.mts +1 -0
- package/src/functional/optional/impl/optional-filter.mts +1 -0
- package/src/functional/optional/impl/optional-flat-map.mts +1 -0
- package/src/functional/optional/impl/optional-from-nullable.mts +1 -0
- package/src/functional/optional/impl/optional-is-none.mts +1 -0
- package/src/functional/optional/impl/optional-is-optional.mts +1 -0
- package/src/functional/optional/impl/optional-is-some.mts +1 -0
- package/src/functional/optional/impl/optional-map.mts +1 -0
- package/src/functional/optional/impl/optional-none.mts +1 -0
- package/src/functional/optional/impl/optional-or-else.mts +1 -0
- package/src/functional/optional/impl/optional-some.mts +1 -0
- package/src/functional/optional/impl/optional-to-nullable.mts +1 -0
- package/src/functional/optional/impl/optional-unwrap-or.mts +1 -0
- package/src/functional/optional/impl/optional-unwrap-throw.mts +1 -0
- package/src/functional/optional/impl/optional-unwrap.mts +2 -0
- package/src/functional/optional/impl/optional-zip.mts +2 -0
- package/src/functional/optional/impl/tag.mts +2 -0
- package/src/functional/optional/impl/types.mts +3 -0
- package/src/functional/optional/index.mts +1 -1
- package/src/functional/optional/optional.mts +19 -0
- package/src/functional/optional.test.mts +1 -0
- package/src/functional/pipe.mts +2 -1
- package/src/functional/pipe.test.mts +1 -0
- package/src/functional/result/impl/result-err.mts +1 -0
- package/src/functional/result/impl/result-expect-to-be.mts +1 -0
- package/src/functional/result/impl/result-flat-map.mts +2 -0
- package/src/functional/result/impl/result-fold.mts +1 -0
- package/src/functional/result/impl/result-from-promise.mts +2 -0
- package/src/functional/result/impl/result-from-throwable.mts +1 -0
- package/src/functional/result/impl/result-is-err.mts +1 -0
- package/src/functional/result/impl/result-is-ok.mts +1 -0
- package/src/functional/result/impl/result-is-result.mts +1 -0
- package/src/functional/result/impl/result-map-err.mts +2 -0
- package/src/functional/result/impl/result-map.mts +2 -0
- package/src/functional/result/impl/result-ok.mts +1 -0
- package/src/functional/result/impl/result-or-else.mts +1 -0
- package/src/functional/result/impl/result-swap.mts +1 -0
- package/src/functional/result/impl/result-to-optional.mts +1 -0
- package/src/functional/result/impl/result-unwrap-err-or.mts +1 -0
- package/src/functional/result/impl/result-unwrap-err-throw.mts +1 -0
- package/src/functional/result/impl/result-unwrap-err.mts +1 -0
- package/src/functional/result/impl/result-unwrap-ok-or.mts +1 -0
- package/src/functional/result/impl/result-unwrap-ok.mts +2 -0
- package/src/functional/result/impl/result-unwrap-throw.mts +1 -0
- package/src/functional/result/impl/result-zip.mts +1 -0
- package/src/functional/result/impl/tag.mts +2 -0
- package/src/functional/result/impl/types.mts +3 -0
- package/src/functional/result/index.mts +1 -1
- package/src/functional/result/result.mts +19 -0
- package/src/functional/result.test.mts +1 -0
- package/src/functional/ternary-result/impl/tag.mts +6 -0
- package/src/functional/ternary-result/impl/ternary-result-err.mts +1 -0
- 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 +5 -0
- package/src/functional/ternary-result/impl/ternary-result-fold.mts +4 -0
- package/src/functional/ternary-result/impl/ternary-result-from-promise.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-from-throwable.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-is-err.mts +1 -0
- 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 +1 -0
- package/src/functional/ternary-result/impl/ternary-result-is-warn.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-map-err.mts +4 -0
- package/src/functional/ternary-result/impl/ternary-result-map-warn.mts +4 -0
- package/src/functional/ternary-result/impl/ternary-result-map.mts +5 -0
- package/src/functional/ternary-result/impl/ternary-result-ok.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-or-else.mts +4 -0
- package/src/functional/ternary-result/impl/ternary-result-to-optional.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts +4 -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 +1 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mts +4 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-ok.mts +4 -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 +4 -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 +1 -0
- package/src/functional/ternary-result/impl/ternary-result-warn.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-zip.mts +1 -0
- package/src/functional/ternary-result/impl/types.mts +7 -0
- package/src/functional/ternary-result/impl/variant-name.mts +1 -0
- package/src/functional/ternary-result/index.mts +1 -1
- package/src/functional/ternary-result/ternary-result.mts +54 -0
- package/src/guard/has-key.mts +2 -0
- package/src/guard/has-key.test.mts +4 -0
- package/src/guard/is-non-empty-string.mts +2 -0
- package/src/guard/is-non-null-object.test.mts +1 -0
- package/src/guard/is-primitive.mts +1 -0
- package/src/guard/is-record.mts +1 -0
- package/src/guard/is-record.test.mts +1 -0
- package/src/guard/is-type.mts +2 -0
- package/src/guard/key-is-in.mts +2 -0
- package/src/guard/key-is-in.test.mts +2 -0
- package/src/iterator/range.mts +6 -0
- package/src/json/json.mts +5 -0
- package/src/number/branded-types/finite-number.mts +7 -0
- package/src/number/branded-types/int.mts +3 -0
- package/src/number/branded-types/int16.mts +3 -0
- package/src/number/branded-types/int32.mts +3 -0
- package/src/number/branded-types/non-negative-finite-number.mts +6 -0
- package/src/number/branded-types/non-negative-int16.mts +3 -0
- package/src/number/branded-types/non-negative-int32.mts +3 -0
- package/src/number/branded-types/non-zero-finite-number.mts +8 -0
- package/src/number/branded-types/non-zero-int.mts +3 -0
- package/src/number/branded-types/non-zero-int16.mts +3 -0
- package/src/number/branded-types/non-zero-int32.mts +3 -0
- package/src/number/branded-types/non-zero-safe-int.mts +7 -0
- package/src/number/branded-types/non-zero-uint16.mts +3 -0
- package/src/number/branded-types/non-zero-uint32.mts +3 -0
- package/src/number/branded-types/positive-finite-number.mts +7 -0
- package/src/number/branded-types/positive-int.mts +3 -0
- package/src/number/branded-types/positive-int16.mts +3 -0
- package/src/number/branded-types/positive-int32.mts +3 -0
- package/src/number/branded-types/positive-safe-int.mts +6 -0
- package/src/number/branded-types/positive-uint16.mts +3 -0
- package/src/number/branded-types/positive-uint32.mts +3 -0
- package/src/number/branded-types/safe-int.mts +6 -0
- package/src/number/branded-types/safe-uint.mts +3 -0
- package/src/number/branded-types/uint.mts +3 -0
- package/src/number/branded-types/uint16.mts +3 -0
- package/src/number/branded-types/uint32.mts +3 -0
- package/src/number/enum/int8.mts +7 -0
- package/src/number/enum/uint8.mts +3 -0
- package/src/number/num.mts +18 -0
- package/src/number/num.test.mts +1 -0
- package/src/number/refined-number-utils.mts +15 -0
- package/src/object/object.mts +13 -0
- package/src/object/object.test.mts +5 -0
- package/src/others/cast-mutable.mts +3 -0
- package/src/others/cast-readonly.mts +3 -0
- package/src/others/debounce-function.test.mts +0 -2
- package/src/others/fast-deep-equal.test.mts +1 -1
- package/src/others/map-nullable.test.mts +1 -0
- package/src/others/memoize-function.mts +2 -0
- package/src/types.mts +131 -0
- package/dist/globals.d.mts +0 -194
- package/src/globals.d.mts +0 -194
package/src/number/num.mts
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Decrement,
|
|
3
|
+
type Increment,
|
|
4
|
+
type Index,
|
|
5
|
+
type Int,
|
|
6
|
+
type Min,
|
|
7
|
+
type NaNType,
|
|
8
|
+
type NegativeIndex,
|
|
9
|
+
type NonNegativeNumber,
|
|
10
|
+
type NonZeroNumber,
|
|
11
|
+
type PositiveNumber,
|
|
12
|
+
type PositiveSafeIntWithSmallInt,
|
|
13
|
+
type RelaxedExclude,
|
|
14
|
+
type SmallInt,
|
|
15
|
+
type SmallUint,
|
|
16
|
+
type UnknownBrand,
|
|
17
|
+
} from 'ts-type-forge';
|
|
1
18
|
import { expectType } from '../expect-type.mjs';
|
|
19
|
+
import { type SmallPositiveInt } from '../types.mjs';
|
|
2
20
|
|
|
3
21
|
/**
|
|
4
22
|
* Namespace providing utility functions for number manipulation and validation.
|
package/src/number/num.test.mts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Brand,
|
|
3
|
+
type ChangeBaseBrand,
|
|
4
|
+
type GetBrandValuePart,
|
|
5
|
+
type Int,
|
|
6
|
+
type IntersectBrand,
|
|
7
|
+
type NonNegativeNumber,
|
|
8
|
+
type NonZeroNumber,
|
|
9
|
+
type RelaxedExclude,
|
|
10
|
+
type TypeEq,
|
|
11
|
+
type UnknownBrand,
|
|
12
|
+
type UnwrapBrandFalseKeys,
|
|
13
|
+
type UnwrapBrandTrueKeys,
|
|
14
|
+
type WithSmallInt,
|
|
15
|
+
} from 'ts-type-forge';
|
|
1
16
|
import { expectType } from '../expect-type.mjs';
|
|
2
17
|
import { pipe } from '../functional/index.mjs';
|
|
3
18
|
import { Num } from './num.mjs';
|
package/src/object/object.mts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ArrayElement,
|
|
3
|
+
type Decrement,
|
|
4
|
+
type DeepOmit,
|
|
5
|
+
type DeepPick,
|
|
6
|
+
type IsFixedLengthList,
|
|
7
|
+
type IsUnion,
|
|
8
|
+
type List,
|
|
9
|
+
type ReadonlyRecord,
|
|
10
|
+
type RelaxedPick,
|
|
11
|
+
type TypeEq,
|
|
12
|
+
type UnknownRecord,
|
|
13
|
+
} from 'ts-type-forge';
|
|
1
14
|
import { Arr } from '../array/index.mjs';
|
|
2
15
|
import { hasKey, isRecord } from '../guard/index.mjs';
|
|
3
16
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type DeepMutable, type Mutable } from 'ts-type-forge';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Casts a readonly type `T` to its `Mutable<T>` equivalent.
|
|
3
5
|
*
|
|
@@ -13,6 +15,7 @@
|
|
|
13
15
|
* @see castReadonly - For the opposite operation
|
|
14
16
|
*/
|
|
15
17
|
export const castMutable = <T,>(readonlyValue: T): Mutable<T> =>
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
16
19
|
readonlyValue as Mutable<T>;
|
|
17
20
|
|
|
18
21
|
/**
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type DeepReadonly } from 'ts-type-forge';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Casts a mutable type `T` to its `Readonly<T>` equivalent.
|
|
3
5
|
*
|
|
@@ -13,6 +15,7 @@
|
|
|
13
15
|
* @see castMutable - For the opposite operation (use with caution)
|
|
14
16
|
*/
|
|
15
17
|
export const castReadonly = <T,>(mutable: T): Readonly<T> =>
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
16
19
|
mutable as Readonly<T>;
|
|
17
20
|
|
|
18
21
|
/**
|
|
@@ -16,7 +16,6 @@ describe(debounce, () => {
|
|
|
16
16
|
test('should delay the execution of the function', () => {
|
|
17
17
|
const func = vi.fn();
|
|
18
18
|
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/strict-void-return
|
|
20
19
|
const debouncedFunc = debounce(func, 100);
|
|
21
20
|
|
|
22
21
|
debouncedFunc();
|
|
@@ -35,7 +34,6 @@ describe(debounce, () => {
|
|
|
35
34
|
test('should only execute the function once after multiple rapid calls', () => {
|
|
36
35
|
const func = vi.fn();
|
|
37
36
|
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/strict-void-return
|
|
39
37
|
const debouncedFunc = debounce(func, 100);
|
|
40
38
|
|
|
41
39
|
debouncedFunc();
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
/* eslint-disable require-unicode-regexp */
|
|
4
4
|
/* eslint-disable no-restricted-globals */
|
|
5
5
|
/* eslint-disable functional/no-class-inheritance */
|
|
6
|
-
|
|
7
6
|
import * as React from 'react';
|
|
7
|
+
import { type ReadonlyRecord } from 'ts-type-forge';
|
|
8
8
|
import { fastDeepEqual } from './fast-deep-equal.mjs';
|
|
9
9
|
|
|
10
10
|
const fastDeepEqualUntyped = (a: any, b: any): boolean => fastDeepEqual(a, b);
|
package/src/types.mts
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type IndexOfTuple,
|
|
3
|
+
type IntersectBrand,
|
|
4
|
+
type IsFixedLengthList,
|
|
5
|
+
type NegativeIndexOfTuple,
|
|
6
|
+
type NegativeInt32,
|
|
7
|
+
type NormalizeBrandUnion,
|
|
8
|
+
type PositiveInt,
|
|
9
|
+
type PositiveNumber,
|
|
10
|
+
type Primitive,
|
|
11
|
+
type SafeInt,
|
|
12
|
+
type SafeUint,
|
|
13
|
+
type Uint32,
|
|
14
|
+
type WithSmallInt,
|
|
15
|
+
} from 'ts-type-forge';
|
|
16
|
+
|
|
17
|
+
export type SmallPositiveInt = WithSmallInt<PositiveInt>;
|
|
18
|
+
|
|
19
|
+
/** Represents the type of keys that can be used in a standard JavaScript Map. */
|
|
20
|
+
export type MapSetKeyType = Primitive;
|
|
21
|
+
|
|
22
|
+
export type ArrayIndex<Ar extends readonly unknown[]> =
|
|
23
|
+
IsFixedLengthList<Ar> extends true ? IndexOfTuple<Ar> : SizeType.Arr;
|
|
24
|
+
|
|
25
|
+
export type ArgArrayIndex<Ar extends readonly unknown[]> =
|
|
26
|
+
IsFixedLengthList<Ar> extends true ? IndexOfTuple<Ar> : SizeType.ArgArr;
|
|
27
|
+
|
|
28
|
+
export type ArgArrayIndexWithNegative<Ar extends readonly unknown[]> =
|
|
29
|
+
IsFixedLengthList<Ar> extends true
|
|
30
|
+
? IndexOfTuple<readonly [...Ar, 0]> | NegativeIndexOfTuple<Ar>
|
|
31
|
+
: SizeType.ArgArrWithNegative;
|
|
32
|
+
|
|
33
|
+
// https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/length
|
|
34
|
+
// https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/length
|
|
35
|
+
// Max array length : 2^32 - 1
|
|
36
|
+
// Max string length : 2^53 - 1
|
|
37
|
+
|
|
38
|
+
export namespace SizeType {
|
|
39
|
+
export type Arr = Uint32;
|
|
40
|
+
|
|
41
|
+
export type TypedArray = SafeUint;
|
|
42
|
+
|
|
43
|
+
export type Str = SafeUint;
|
|
44
|
+
|
|
45
|
+
export type ArrSearchResult = Arr | -1;
|
|
46
|
+
|
|
47
|
+
export type TypedArraySearchResult = TypedArray | -1;
|
|
48
|
+
|
|
49
|
+
export type StrSearchResult = Str | -1;
|
|
50
|
+
|
|
51
|
+
export type ArgArr = WithSmallInt<Arr>;
|
|
52
|
+
|
|
53
|
+
export type ArgTypedArray = WithSmallInt<TypedArray>;
|
|
54
|
+
|
|
55
|
+
export type ArgStr = WithSmallInt<Str>;
|
|
56
|
+
|
|
57
|
+
export type ArgArrWithNegative = WithSmallInt<
|
|
58
|
+
NormalizeBrandUnion<NegativeInt32 | Arr>
|
|
59
|
+
>;
|
|
60
|
+
|
|
61
|
+
export type ArgTypedArrayWithNegative = WithSmallInt<SafeInt>;
|
|
62
|
+
|
|
63
|
+
export type ArgStrWithNegative = WithSmallInt<SafeInt>;
|
|
64
|
+
|
|
65
|
+
export type ArgArrPositive = WithSmallInt<
|
|
66
|
+
IntersectBrand<PositiveNumber, Arr>
|
|
67
|
+
>;
|
|
68
|
+
|
|
69
|
+
export type ArgTypedArrayPositive = WithSmallInt<
|
|
70
|
+
IntersectBrand<PositiveNumber, TypedArray>
|
|
71
|
+
>;
|
|
72
|
+
|
|
73
|
+
export type ArgStrPositive = WithSmallInt<
|
|
74
|
+
IntersectBrand<PositiveNumber, Str>
|
|
75
|
+
>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// #region Optional
|
|
79
|
+
/**
|
|
80
|
+
* Represents the 'Some' variant of an Optional, containing a value.
|
|
81
|
+
*
|
|
82
|
+
* @template S The type of the contained value.
|
|
83
|
+
*/
|
|
84
|
+
export type Some<S> = Readonly<{
|
|
85
|
+
/** @internal Discriminant property for the 'Some' type. */
|
|
86
|
+
$$tag: 'ts-data-forge::Optional.some';
|
|
87
|
+
|
|
88
|
+
/** The contained value. */
|
|
89
|
+
value: S;
|
|
90
|
+
}>;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Represents the 'None' variant of an Optional, indicating the absence
|
|
94
|
+
* of a value.
|
|
95
|
+
*/
|
|
96
|
+
export type None = Readonly<{
|
|
97
|
+
/** @internal Discriminant property for the 'None' type. */
|
|
98
|
+
$$tag: 'ts-data-forge::Optional.none';
|
|
99
|
+
}>;
|
|
100
|
+
|
|
101
|
+
// #endregion Optional
|
|
102
|
+
|
|
103
|
+
// #region Result
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Represents a `Result` that is a success, containing a value.
|
|
107
|
+
*
|
|
108
|
+
* @template S The type of the success value.
|
|
109
|
+
*/
|
|
110
|
+
export type Ok<S> = Readonly<{
|
|
111
|
+
/** @internal Discriminant property for the 'Ok' type. */
|
|
112
|
+
$$tag: 'ts-data-forge::Result.ok';
|
|
113
|
+
|
|
114
|
+
/** The success value. */
|
|
115
|
+
value: S;
|
|
116
|
+
}>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Represents a `Result` that is an error, containing an error value.
|
|
120
|
+
*
|
|
121
|
+
* @template E The type of the error value.
|
|
122
|
+
*/
|
|
123
|
+
export type Err<E> = Readonly<{
|
|
124
|
+
/** @internal Discriminant property for the 'Err' type. */
|
|
125
|
+
$$tag: 'ts-data-forge::Result.err';
|
|
126
|
+
|
|
127
|
+
/** The error value. */
|
|
128
|
+
value: E;
|
|
129
|
+
}>;
|
|
130
|
+
|
|
131
|
+
// #endregion Result
|
package/dist/globals.d.mts
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/// <reference types="ts-type-forge" />
|
|
2
|
-
|
|
3
|
-
type SmallPositiveInt = WithSmallInt<PositiveInt>;
|
|
4
|
-
|
|
5
|
-
/** Represents the type of keys that can be used in a standard JavaScript Map. */
|
|
6
|
-
type MapSetKeyType = Primitive;
|
|
7
|
-
|
|
8
|
-
type ArrayIndex<Ar extends readonly unknown[]> =
|
|
9
|
-
IsFixedLengthList<Ar> extends true ? IndexOfTuple<Ar> : SizeType.Arr;
|
|
10
|
-
|
|
11
|
-
type ArgArrayIndex<Ar extends readonly unknown[]> =
|
|
12
|
-
IsFixedLengthList<Ar> extends true ? IndexOfTuple<Ar> : SizeType.ArgArr;
|
|
13
|
-
|
|
14
|
-
type ArgArrayIndexWithNegative<Ar extends readonly unknown[]> =
|
|
15
|
-
IsFixedLengthList<Ar> extends true
|
|
16
|
-
? IndexOfTuple<readonly [...Ar, 0]> | NegativeIndexOfTuple<Ar>
|
|
17
|
-
: SizeType.ArgArrWithNegative;
|
|
18
|
-
|
|
19
|
-
// https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/length
|
|
20
|
-
// https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/length
|
|
21
|
-
// Max array length : 2^32 - 1
|
|
22
|
-
// Max string length : 2^53 - 1
|
|
23
|
-
|
|
24
|
-
declare namespace SizeType {
|
|
25
|
-
type Arr = Uint32;
|
|
26
|
-
|
|
27
|
-
type TypedArray = SafeUint;
|
|
28
|
-
|
|
29
|
-
type Str = SafeUint;
|
|
30
|
-
|
|
31
|
-
type ArrSearchResult = Arr | -1;
|
|
32
|
-
|
|
33
|
-
type TypedArraySearchResult = TypedArray | -1;
|
|
34
|
-
|
|
35
|
-
type StrSearchResult = Str | -1;
|
|
36
|
-
|
|
37
|
-
type ArgArr = WithSmallInt<Arr>;
|
|
38
|
-
|
|
39
|
-
type ArgTypedArray = WithSmallInt<TypedArray>;
|
|
40
|
-
|
|
41
|
-
type ArgStr = WithSmallInt<Str>;
|
|
42
|
-
|
|
43
|
-
type ArgArrWithNegative = WithSmallInt<
|
|
44
|
-
NormalizeBrandUnion<NegativeInt32 | Arr>
|
|
45
|
-
>;
|
|
46
|
-
|
|
47
|
-
type ArgTypedArrayWithNegative = WithSmallInt<SafeInt>;
|
|
48
|
-
|
|
49
|
-
type ArgStrWithNegative = WithSmallInt<SafeInt>;
|
|
50
|
-
|
|
51
|
-
type ArgArrPositive = WithSmallInt<IntersectBrand<PositiveNumber, Arr>>;
|
|
52
|
-
|
|
53
|
-
type ArgTypedArrayPositive = WithSmallInt<
|
|
54
|
-
IntersectBrand<PositiveNumber, TypedArray>
|
|
55
|
-
>;
|
|
56
|
-
|
|
57
|
-
type ArgStrPositive = WithSmallInt<IntersectBrand<PositiveNumber, Str>>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// #region Optional
|
|
61
|
-
/**
|
|
62
|
-
* Represents the 'Some' variant of an {@link Optional}, containing a value.
|
|
63
|
-
*
|
|
64
|
-
* @template S The type of the contained value.
|
|
65
|
-
*/
|
|
66
|
-
type Some<S> = Readonly<{
|
|
67
|
-
/** @internal Discriminant property for the 'Some' type. */
|
|
68
|
-
$$tag: 'ts-data-forge::Optional.some';
|
|
69
|
-
|
|
70
|
-
/** The contained value. */
|
|
71
|
-
value: S;
|
|
72
|
-
}>;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Represents the 'None' variant of an {@link Optional}, indicating the absence
|
|
76
|
-
* of a value.
|
|
77
|
-
*/
|
|
78
|
-
type None = Readonly<{
|
|
79
|
-
/** @internal Discriminant property for the 'None' type. */
|
|
80
|
-
$$tag: 'ts-data-forge::Optional.none';
|
|
81
|
-
}>;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Represents an optional value that can either be `Some` (containing a value)
|
|
85
|
-
* or `None` (empty).
|
|
86
|
-
*
|
|
87
|
-
* @template S The type of the value that might be present.
|
|
88
|
-
*/
|
|
89
|
-
type Optional<S> = None | Some<S>;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Base type for any {@link Optional}, used for generic constraints. Represents
|
|
93
|
-
* an {@link Optional} with an unknown value type.
|
|
94
|
-
*/
|
|
95
|
-
type UnknownOptional = Optional<unknown>;
|
|
96
|
-
|
|
97
|
-
// #endregion Optional
|
|
98
|
-
|
|
99
|
-
// #region Result
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Represents a `Result` that is a success, containing a value.
|
|
103
|
-
*
|
|
104
|
-
* @template S The type of the success value.
|
|
105
|
-
*/
|
|
106
|
-
type Ok<S> = Readonly<{
|
|
107
|
-
/** @internal Discriminant property for the 'Ok' type. */
|
|
108
|
-
$$tag: 'ts-data-forge::Result.ok';
|
|
109
|
-
|
|
110
|
-
/** The success value. */
|
|
111
|
-
value: S;
|
|
112
|
-
}>;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Represents a `Result` that is an error, containing an error value.
|
|
116
|
-
*
|
|
117
|
-
* @template E The type of the error value.
|
|
118
|
-
*/
|
|
119
|
-
type Err<E> = Readonly<{
|
|
120
|
-
/** @internal Discriminant property for the 'Err' type. */
|
|
121
|
-
$$tag: 'ts-data-forge::Result.err';
|
|
122
|
-
|
|
123
|
-
/** The error value. */
|
|
124
|
-
value: E;
|
|
125
|
-
}>;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Represents a value that can either be a success (`Ok`) or an error (`Err`).
|
|
129
|
-
*
|
|
130
|
-
* @template S The type of the success value.
|
|
131
|
-
* @template E The type of the error value.
|
|
132
|
-
*/
|
|
133
|
-
type Result<S, E> = Ok<S> | Err<E>;
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Base type for any `Result`, used for generic constraints. Represents a
|
|
137
|
-
* `Result` with unknown success and error types.
|
|
138
|
-
*/
|
|
139
|
-
type UnknownResult = Result<unknown, unknown>;
|
|
140
|
-
|
|
141
|
-
// #endregion Result
|
|
142
|
-
|
|
143
|
-
// #region TernaryResult
|
|
144
|
-
/**
|
|
145
|
-
* Represents a `TernaryResult` that is a success, containing a value.
|
|
146
|
-
*/
|
|
147
|
-
type TernaryOk<S> = Readonly<{
|
|
148
|
-
/** @internal Discriminant property for the 'Ok' type. */
|
|
149
|
-
$$tag: 'ts-data-forge::Result.ok';
|
|
150
|
-
|
|
151
|
-
/** The success value. */
|
|
152
|
-
value: S;
|
|
153
|
-
}>;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Represents a `TernaryResult` that contains a success value and an attached
|
|
157
|
-
* warning.
|
|
158
|
-
*/
|
|
159
|
-
type TernaryWarn<S, W> = Readonly<{
|
|
160
|
-
/** @internal Discriminant property for the 'Warn' type. */
|
|
161
|
-
$$tag: 'ts-data-forge::Result.warn';
|
|
162
|
-
|
|
163
|
-
/** The success value. */
|
|
164
|
-
value: S;
|
|
165
|
-
|
|
166
|
-
/** The warning value. */
|
|
167
|
-
warning: W;
|
|
168
|
-
}>;
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Represents a `TernaryResult` that is an error, containing an error value.
|
|
172
|
-
*/
|
|
173
|
-
type TernaryErr<E> = Readonly<{
|
|
174
|
-
/** @internal Discriminant property for the 'Err' type. */
|
|
175
|
-
$$tag: 'ts-data-forge::Result.err';
|
|
176
|
-
|
|
177
|
-
/** The error value. */
|
|
178
|
-
value: E;
|
|
179
|
-
}>;
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Represents a value that can be `Ok`, `Warn`, or `Err`.
|
|
183
|
-
*/
|
|
184
|
-
type TernaryResult<S, E, W = E> =
|
|
185
|
-
| TernaryOk<S>
|
|
186
|
-
| TernaryWarn<S, W>
|
|
187
|
-
| TernaryErr<E>;
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Base type for any `TernaryResult`, used for generic constraints.
|
|
191
|
-
*/
|
|
192
|
-
type UnknownTernaryResult = TernaryResult<unknown, unknown, unknown>;
|
|
193
|
-
|
|
194
|
-
// #endregion TernaryResult
|
package/src/globals.d.mts
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/// <reference types="ts-type-forge" />
|
|
2
|
-
|
|
3
|
-
type SmallPositiveInt = WithSmallInt<PositiveInt>;
|
|
4
|
-
|
|
5
|
-
/** Represents the type of keys that can be used in a standard JavaScript Map. */
|
|
6
|
-
type MapSetKeyType = Primitive;
|
|
7
|
-
|
|
8
|
-
type ArrayIndex<Ar extends readonly unknown[]> =
|
|
9
|
-
IsFixedLengthList<Ar> extends true ? IndexOfTuple<Ar> : SizeType.Arr;
|
|
10
|
-
|
|
11
|
-
type ArgArrayIndex<Ar extends readonly unknown[]> =
|
|
12
|
-
IsFixedLengthList<Ar> extends true ? IndexOfTuple<Ar> : SizeType.ArgArr;
|
|
13
|
-
|
|
14
|
-
type ArgArrayIndexWithNegative<Ar extends readonly unknown[]> =
|
|
15
|
-
IsFixedLengthList<Ar> extends true
|
|
16
|
-
? IndexOfTuple<readonly [...Ar, 0]> | NegativeIndexOfTuple<Ar>
|
|
17
|
-
: SizeType.ArgArrWithNegative;
|
|
18
|
-
|
|
19
|
-
// https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/length
|
|
20
|
-
// https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/length
|
|
21
|
-
// Max array length : 2^32 - 1
|
|
22
|
-
// Max string length : 2^53 - 1
|
|
23
|
-
|
|
24
|
-
declare namespace SizeType {
|
|
25
|
-
type Arr = Uint32;
|
|
26
|
-
|
|
27
|
-
type TypedArray = SafeUint;
|
|
28
|
-
|
|
29
|
-
type Str = SafeUint;
|
|
30
|
-
|
|
31
|
-
type ArrSearchResult = Arr | -1;
|
|
32
|
-
|
|
33
|
-
type TypedArraySearchResult = TypedArray | -1;
|
|
34
|
-
|
|
35
|
-
type StrSearchResult = Str | -1;
|
|
36
|
-
|
|
37
|
-
type ArgArr = WithSmallInt<Arr>;
|
|
38
|
-
|
|
39
|
-
type ArgTypedArray = WithSmallInt<TypedArray>;
|
|
40
|
-
|
|
41
|
-
type ArgStr = WithSmallInt<Str>;
|
|
42
|
-
|
|
43
|
-
type ArgArrWithNegative = WithSmallInt<
|
|
44
|
-
NormalizeBrandUnion<NegativeInt32 | Arr>
|
|
45
|
-
>;
|
|
46
|
-
|
|
47
|
-
type ArgTypedArrayWithNegative = WithSmallInt<SafeInt>;
|
|
48
|
-
|
|
49
|
-
type ArgStrWithNegative = WithSmallInt<SafeInt>;
|
|
50
|
-
|
|
51
|
-
type ArgArrPositive = WithSmallInt<IntersectBrand<PositiveNumber, Arr>>;
|
|
52
|
-
|
|
53
|
-
type ArgTypedArrayPositive = WithSmallInt<
|
|
54
|
-
IntersectBrand<PositiveNumber, TypedArray>
|
|
55
|
-
>;
|
|
56
|
-
|
|
57
|
-
type ArgStrPositive = WithSmallInt<IntersectBrand<PositiveNumber, Str>>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// #region Optional
|
|
61
|
-
/**
|
|
62
|
-
* Represents the 'Some' variant of an {@link Optional}, containing a value.
|
|
63
|
-
*
|
|
64
|
-
* @template S The type of the contained value.
|
|
65
|
-
*/
|
|
66
|
-
type Some<S> = Readonly<{
|
|
67
|
-
/** @internal Discriminant property for the 'Some' type. */
|
|
68
|
-
$$tag: 'ts-data-forge::Optional.some';
|
|
69
|
-
|
|
70
|
-
/** The contained value. */
|
|
71
|
-
value: S;
|
|
72
|
-
}>;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Represents the 'None' variant of an {@link Optional}, indicating the absence
|
|
76
|
-
* of a value.
|
|
77
|
-
*/
|
|
78
|
-
type None = Readonly<{
|
|
79
|
-
/** @internal Discriminant property for the 'None' type. */
|
|
80
|
-
$$tag: 'ts-data-forge::Optional.none';
|
|
81
|
-
}>;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Represents an optional value that can either be `Some` (containing a value)
|
|
85
|
-
* or `None` (empty).
|
|
86
|
-
*
|
|
87
|
-
* @template S The type of the value that might be present.
|
|
88
|
-
*/
|
|
89
|
-
type Optional<S> = None | Some<S>;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Base type for any {@link Optional}, used for generic constraints. Represents
|
|
93
|
-
* an {@link Optional} with an unknown value type.
|
|
94
|
-
*/
|
|
95
|
-
type UnknownOptional = Optional<unknown>;
|
|
96
|
-
|
|
97
|
-
// #endregion Optional
|
|
98
|
-
|
|
99
|
-
// #region Result
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Represents a `Result` that is a success, containing a value.
|
|
103
|
-
*
|
|
104
|
-
* @template S The type of the success value.
|
|
105
|
-
*/
|
|
106
|
-
type Ok<S> = Readonly<{
|
|
107
|
-
/** @internal Discriminant property for the 'Ok' type. */
|
|
108
|
-
$$tag: 'ts-data-forge::Result.ok';
|
|
109
|
-
|
|
110
|
-
/** The success value. */
|
|
111
|
-
value: S;
|
|
112
|
-
}>;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Represents a `Result` that is an error, containing an error value.
|
|
116
|
-
*
|
|
117
|
-
* @template E The type of the error value.
|
|
118
|
-
*/
|
|
119
|
-
type Err<E> = Readonly<{
|
|
120
|
-
/** @internal Discriminant property for the 'Err' type. */
|
|
121
|
-
$$tag: 'ts-data-forge::Result.err';
|
|
122
|
-
|
|
123
|
-
/** The error value. */
|
|
124
|
-
value: E;
|
|
125
|
-
}>;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Represents a value that can either be a success (`Ok`) or an error (`Err`).
|
|
129
|
-
*
|
|
130
|
-
* @template S The type of the success value.
|
|
131
|
-
* @template E The type of the error value.
|
|
132
|
-
*/
|
|
133
|
-
type Result<S, E> = Ok<S> | Err<E>;
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Base type for any `Result`, used for generic constraints. Represents a
|
|
137
|
-
* `Result` with unknown success and error types.
|
|
138
|
-
*/
|
|
139
|
-
type UnknownResult = Result<unknown, unknown>;
|
|
140
|
-
|
|
141
|
-
// #endregion Result
|
|
142
|
-
|
|
143
|
-
// #region TernaryResult
|
|
144
|
-
/**
|
|
145
|
-
* Represents a `TernaryResult` that is a success, containing a value.
|
|
146
|
-
*/
|
|
147
|
-
type TernaryOk<S> = Readonly<{
|
|
148
|
-
/** @internal Discriminant property for the 'Ok' type. */
|
|
149
|
-
$$tag: 'ts-data-forge::Result.ok';
|
|
150
|
-
|
|
151
|
-
/** The success value. */
|
|
152
|
-
value: S;
|
|
153
|
-
}>;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Represents a `TernaryResult` that contains a success value and an attached
|
|
157
|
-
* warning.
|
|
158
|
-
*/
|
|
159
|
-
type TernaryWarn<S, W> = Readonly<{
|
|
160
|
-
/** @internal Discriminant property for the 'Warn' type. */
|
|
161
|
-
$$tag: 'ts-data-forge::Result.warn';
|
|
162
|
-
|
|
163
|
-
/** The success value. */
|
|
164
|
-
value: S;
|
|
165
|
-
|
|
166
|
-
/** The warning value. */
|
|
167
|
-
warning: W;
|
|
168
|
-
}>;
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Represents a `TernaryResult` that is an error, containing an error value.
|
|
172
|
-
*/
|
|
173
|
-
type TernaryErr<E> = Readonly<{
|
|
174
|
-
/** @internal Discriminant property for the 'Err' type. */
|
|
175
|
-
$$tag: 'ts-data-forge::Result.err';
|
|
176
|
-
|
|
177
|
-
/** The error value. */
|
|
178
|
-
value: E;
|
|
179
|
-
}>;
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Represents a value that can be `Ok`, `Warn`, or `Err`.
|
|
183
|
-
*/
|
|
184
|
-
type TernaryResult<S, E, W = E> =
|
|
185
|
-
| TernaryOk<S>
|
|
186
|
-
| TernaryWarn<S, W>
|
|
187
|
-
| TernaryErr<E>;
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Base type for any `TernaryResult`, used for generic constraints.
|
|
191
|
-
*/
|
|
192
|
-
type UnknownTernaryResult = TernaryResult<unknown, unknown, unknown>;
|
|
193
|
-
|
|
194
|
-
// #endregion TernaryResult
|