ts-data-forge 5.0.0 → 5.1.0
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 +55 -6
- 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 +7 -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 +1 -0
- package/dist/array/impl/array-utils-modification.mjs.map +1 -1
- package/dist/array/impl/array-utils-reducing-value.d.mts +26 -2
- package/dist/array/impl/array-utils-reducing-value.d.mts.map +1 -1
- package/dist/array/impl/array-utils-reducing-value.mjs +2 -1
- package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -1
- package/dist/array/impl/array-utils-search.d.mts +30 -0
- package/dist/array/impl/array-utils-search.d.mts.map +1 -1
- package/dist/array/impl/array-utils-search.mjs +1 -0
- package/dist/array/impl/array-utils-search.mjs.map +1 -1
- package/dist/array/impl/array-utils-set-op.d.mts +13 -0
- package/dist/array/impl/array-utils-set-op.d.mts.map +1 -1
- package/dist/array/impl/array-utils-set-op.mjs +13 -0
- package/dist/array/impl/array-utils-set-op.mjs.map +1 -1
- package/dist/array/impl/array-utils-size.d.mts +3 -0
- package/dist/array/impl/array-utils-size.d.mts.map +1 -1
- package/dist/array/impl/array-utils-size.mjs +3 -0
- 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 +15 -0
- package/dist/array/impl/array-utils-slicing.d.mts.map +1 -1
- package/dist/array/impl/array-utils-slicing.mjs +7 -0
- 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 +7 -0
- package/dist/array/impl/array-utils-transformation.mjs.map +1 -1
- package/dist/array/impl/array-utils-validation.d.mts +17 -0
- package/dist/array/impl/array-utils-validation.d.mts.map +1 -1
- package/dist/array/impl/array-utils-validation.mjs +11 -0
- package/dist/array/impl/array-utils-validation.mjs.map +1 -1
- package/dist/collections/imap-mapped.mjs +1 -0
- package/dist/collections/imap-mapped.mjs.map +1 -1
- package/dist/collections/imap.d.mts +20 -0
- package/dist/collections/imap.d.mts.map +1 -1
- package/dist/collections/imap.mjs +3 -0
- package/dist/collections/imap.mjs.map +1 -1
- package/dist/collections/iset-mapped.d.mts +27 -0
- package/dist/collections/iset-mapped.d.mts.map +1 -1
- package/dist/collections/iset-mapped.mjs +7 -0
- package/dist/collections/iset-mapped.mjs.map +1 -1
- package/dist/collections/iset.d.mts +29 -0
- package/dist/collections/iset.d.mts.map +1 -1
- package/dist/collections/iset.mjs +7 -0
- package/dist/collections/iset.mjs.map +1 -1
- package/dist/collections/queue.d.mts +40 -0
- package/dist/collections/queue.d.mts.map +1 -1
- package/dist/collections/queue.mjs +9 -0
- package/dist/collections/queue.mjs.map +1 -1
- package/dist/collections/stack.d.mts +35 -0
- package/dist/collections/stack.d.mts.map +1 -1
- package/dist/collections/stack.mjs +8 -0
- package/dist/collections/stack.mjs.map +1 -1
- package/dist/entry-point.mjs +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 +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 +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-optional.d.mts +2 -0
- package/dist/functional/optional/impl/optional-is-optional.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-is-optional.mjs +2 -0
- 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 +1 -0
- 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 +2 -0
- package/dist/functional/optional/impl/optional-none.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-none.mjs +2 -0
- 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 +3 -1
- package/dist/functional/optional/impl/optional-some.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-some.mjs +2 -0
- package/dist/functional/optional/impl/optional-some.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-to-nullable.d.mts +2 -0
- package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-to-nullable.mjs +2 -0
- package/dist/functional/optional/impl/optional-to-nullable.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap-or.d.mts +3 -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 +1 -0
- 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 +2 -0
- package/dist/functional/optional/impl/optional-zip.mjs.map +1 -1
- package/dist/functional/result/impl/result-err.d.mts +3 -1
- package/dist/functional/result/impl/result-err.d.mts.map +1 -1
- package/dist/functional/result/impl/result-err.mjs +2 -0
- 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 +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 +3 -0
- package/dist/functional/result/impl/result-from-promise.d.mts.map +1 -1
- package/dist/functional/result/impl/result-from-promise.mjs +3 -0
- package/dist/functional/result/impl/result-from-promise.mjs.map +1 -1
- package/dist/functional/result/impl/result-from-throwable.d.mts +2 -0
- package/dist/functional/result/impl/result-from-throwable.d.mts.map +1 -1
- package/dist/functional/result/impl/result-from-throwable.mjs +4 -1
- package/dist/functional/result/impl/result-from-throwable.mjs.map +1 -1
- package/dist/functional/result/impl/result-is-err.d.mts +2 -0
- package/dist/functional/result/impl/result-is-err.d.mts.map +1 -1
- package/dist/functional/result/impl/result-is-err.mjs +2 -0
- package/dist/functional/result/impl/result-is-err.mjs.map +1 -1
- package/dist/functional/result/impl/result-is-ok.d.mts +2 -0
- package/dist/functional/result/impl/result-is-ok.d.mts.map +1 -1
- package/dist/functional/result/impl/result-is-ok.mjs +2 -0
- package/dist/functional/result/impl/result-is-ok.mjs.map +1 -1
- package/dist/functional/result/impl/result-is-result.d.mts +4 -0
- package/dist/functional/result/impl/result-is-result.d.mts.map +1 -1
- package/dist/functional/result/impl/result-is-result.mjs +4 -0
- 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 +3 -1
- package/dist/functional/result/impl/result-ok.d.mts.map +1 -1
- package/dist/functional/result/impl/result-ok.mjs +2 -0
- 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 +3 -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 +2 -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 +2 -0
- 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 +1 -0
- package/dist/functional/result/impl/result-unwrap-err.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-ok-or.d.mts +3 -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 +1 -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 +2 -0
- package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-throw.mjs +2 -0
- 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 +2 -1
- package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-err.mjs +1 -0
- 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 +2 -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 +2 -0
- 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 +2 -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 +4 -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 +4 -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 +4 -0
- 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 +10 -0
- 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 +1 -0
- package/dist/guard/key-is-in.d.mts.map +1 -1
- package/dist/guard/key-is-in.mjs +1 -0
- 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 +21 -0
- package/dist/json/json.d.mts.map +1 -1
- package/dist/json/json.mjs +22 -0
- package/dist/json/json.mjs.map +1 -1
- package/dist/number/branded-types/int.d.mts +14 -0
- package/dist/number/branded-types/int.d.mts.map +1 -1
- package/dist/number/branded-types/int.mjs +14 -0
- 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 +14 -0
- package/dist/number/branded-types/positive-int.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int.mjs +14 -0
- package/dist/number/branded-types/positive-int.mjs.map +1 -1
- package/dist/number/branded-types/positive-safe-int.d.mts +21 -0
- package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/positive-safe-int.mjs +22 -1
- package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/safe-int.d.mts +21 -0
- package/dist/number/branded-types/safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/safe-int.mjs +23 -2
- 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 +12 -0
- package/dist/number/branded-types/uint.d.mts.map +1 -1
- package/dist/number/branded-types/uint.mjs +12 -0
- package/dist/number/branded-types/uint.mjs.map +1 -1
- package/dist/number/num.d.mts +9 -0
- package/dist/number/num.d.mts.map +1 -1
- package/dist/number/num.mjs +8 -1
- package/dist/number/num.mjs.map +1 -1
- package/dist/number/refined-number-utils.d.mts +22 -0
- package/dist/number/refined-number-utils.d.mts.map +1 -1
- package/dist/number/refined-number-utils.mjs +23 -0
- package/dist/number/refined-number-utils.mjs.map +1 -1
- package/dist/object/object.d.mts +9 -0
- package/dist/object/object.d.mts.map +1 -1
- package/dist/object/object.mjs +7 -0
- package/dist/object/object.mjs.map +1 -1
- package/dist/others/map-nullable.mjs.map +1 -1
- package/dist/others/tuple.d.mts +11 -0
- package/dist/others/tuple.d.mts.map +1 -1
- package/dist/others/tuple.mjs +11 -0
- 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 +2 -1
- package/dist/others/unknown-to-string.mjs.map +1 -1
- package/dist/promise/promise.d.mts +4 -0
- package/dist/promise/promise.d.mts.map +1 -1
- package/dist/promise/promise.mjs +5 -0
- package/dist/promise/promise.mjs.map +1 -1
- package/package.json +20 -24
- package/src/array/impl/array-utils-creation.mts +20 -0
- package/src/array/impl/array-utils-creation.test.mts +71 -0
- package/src/array/impl/array-utils-element-access.mts +13 -0
- package/src/array/impl/array-utils-element-access.test.mts +21 -0
- package/src/array/impl/array-utils-iterators.test.mts +17 -0
- package/src/array/impl/array-utils-modification.mts +40 -0
- 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 +55 -9
- package/src/array/impl/array-utils-reducing-value.test.mts +90 -0
- package/src/array/impl/array-utils-search.mts +53 -0
- package/src/array/impl/array-utils-search.test.mts +51 -0
- package/src/array/impl/array-utils-set-op.mts +19 -0
- package/src/array/impl/array-utils-set-op.test.mts +116 -0
- package/src/array/impl/array-utils-size.mts +3 -0
- 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 +27 -0
- 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 +113 -1
- package/src/array/impl/array-utils-validation.mts +23 -0
- package/src/array/impl/array-utils-validation.test.mts +96 -0
- package/src/array/impl/array.test.mts +12 -0
- package/src/collections/imap-mapped.mts +11 -0
- package/src/collections/imap-mapped.test.mts +70 -0
- package/src/collections/imap.mts +32 -0
- package/src/collections/imap.test.mts +106 -0
- package/src/collections/iset-mapped.mts +35 -0
- package/src/collections/iset-mapped.test.mts +111 -0
- package/src/collections/iset.mts +34 -0
- package/src/collections/iset.test.mts +193 -0
- package/src/collections/queue.mts +53 -0
- package/src/collections/queue.test.mts +32 -0
- package/src/collections/stack.mts +42 -0
- package/src/collections/stack.test.mts +44 -0
- package/src/functional/match.mts +16 -0
- package/src/functional/match.test.mts +2 -0
- package/src/functional/optional/impl/optional-expect-to-be.mts +3 -0
- 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-optional.mts +2 -0
- package/src/functional/optional/impl/optional-is-some.mts +1 -0
- package/src/functional/optional/impl/optional-map.mts +5 -0
- package/src/functional/optional/impl/optional-none.mts +2 -0
- package/src/functional/optional/impl/optional-or-else.mts +6 -0
- package/src/functional/optional/impl/optional-some.mts +3 -1
- package/src/functional/optional/impl/optional-to-nullable.mts +2 -0
- package/src/functional/optional/impl/optional-unwrap-or.mts +5 -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.test.mts +73 -0
- package/src/functional/pipe.test.mts +3 -0
- package/src/functional/result/impl/result-err.mts +3 -1
- package/src/functional/result/impl/result-expect-to-be.mts +3 -0
- 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 +3 -0
- package/src/functional/result/impl/result-from-throwable.mts +6 -1
- package/src/functional/result/impl/result-is-err.mts +2 -0
- package/src/functional/result/impl/result-is-ok.mts +2 -0
- package/src/functional/result/impl/result-is-result.mts +4 -0
- 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 +3 -1
- 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 +5 -0
- package/src/functional/result/impl/result-unwrap-err-throw.mts +2 -0
- package/src/functional/result/impl/result-unwrap-err.mts +1 -0
- package/src/functional/result/impl/result-unwrap-ok-or.mts +5 -0
- package/src/functional/result/impl/result-unwrap-ok.mts +2 -0
- package/src/functional/result/impl/result-unwrap-throw.mts +2 -0
- package/src/functional/result/impl/result-zip.mts +3 -1
- package/src/functional/result.test.mts +88 -0
- package/src/functional/ternary-result/impl/ternary-result-err.mts +2 -1
- 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 +2 -0
- package/src/functional/ternary-result/impl/ternary-result-from-throwable.mts +5 -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 +4 -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 +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 +91 -0
- package/src/globals.d.mts +10 -0
- package/src/guard/has-key.test.mts +9 -0
- package/src/guard/is-non-empty-string.test.mts +20 -0
- package/src/guard/is-non-null-object.test.mts +19 -0
- package/src/guard/is-primitive.test.mts +23 -0
- package/src/guard/is-record.mts +34 -0
- package/src/guard/is-record.test.mts +21 -0
- package/src/guard/is-type.mts +3 -0
- package/src/guard/is-type.test.mts +134 -0
- package/src/guard/key-is-in.mts +1 -0
- package/src/iterator/range.mts +9 -0
- package/src/json/json.mts +29 -0
- package/src/json/json.test.mts +87 -0
- package/src/number/branded-types/finite-number.test.mts +38 -0
- package/src/number/branded-types/int.mts +14 -0
- package/src/number/branded-types/int.test.mts +42 -0
- package/src/number/branded-types/int16.test.mts +47 -0
- package/src/number/branded-types/int32.test.mts +47 -0
- package/src/number/branded-types/non-negative-finite-number.test.mts +40 -0
- package/src/number/branded-types/non-negative-int16.test.mts +43 -0
- package/src/number/branded-types/non-negative-int32.test.mts +43 -0
- package/src/number/branded-types/non-zero-finite-number.test.mts +51 -0
- package/src/number/branded-types/non-zero-int.test.mts +53 -0
- package/src/number/branded-types/non-zero-int16.test.mts +44 -0
- package/src/number/branded-types/non-zero-int32.test.mts +44 -0
- package/src/number/branded-types/non-zero-safe-int.mts +2 -2
- package/src/number/branded-types/non-zero-safe-int.test.mts +62 -0
- package/src/number/branded-types/non-zero-uint16.test.mts +37 -0
- package/src/number/branded-types/non-zero-uint32.test.mts +37 -0
- package/src/number/branded-types/positive-finite-number.test.mts +45 -0
- package/src/number/branded-types/positive-int.mts +14 -0
- package/src/number/branded-types/positive-int.test.mts +47 -0
- package/src/number/branded-types/positive-int16.test.mts +35 -0
- package/src/number/branded-types/positive-int32.test.mts +35 -0
- package/src/number/branded-types/positive-safe-int.mts +22 -1
- package/src/number/branded-types/positive-safe-int.test.mts +49 -0
- package/src/number/branded-types/positive-uint16.test.mts +37 -0
- package/src/number/branded-types/positive-uint32.test.mts +37 -0
- package/src/number/branded-types/safe-int.mts +23 -2
- package/src/number/branded-types/safe-int.test.mts +52 -0
- package/src/number/branded-types/safe-uint.mts +1 -1
- package/src/number/branded-types/safe-uint.test.mts +48 -0
- package/src/number/branded-types/uint.mts +12 -0
- package/src/number/branded-types/uint.test.mts +43 -0
- package/src/number/branded-types/uint16.test.mts +41 -0
- package/src/number/branded-types/uint32.test.mts +41 -0
- package/src/number/enum/int8.test.mts +6 -0
- package/src/number/enum/uint8.test.mts +6 -0
- package/src/number/num.mts +12 -1
- package/src/number/num.test.mts +62 -0
- package/src/number/refined-number-utils.mts +25 -0
- package/src/object/object.mts +15 -0
- package/src/object/object.test.mts +10 -0
- package/src/others/cast-mutable.test.mts +7 -0
- package/src/others/cast-readonly.test.mts +17 -0
- package/src/others/if-then.test.mts +16 -0
- 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 +11 -0
- package/src/others/unknown-to-string.mts +4 -1
- package/src/others/unknown-to-string.test.mts +10 -0
- package/src/promise/promise.mts +4 -0
- package/src/promise/promise.test.mts +1 -0
package/README.md
CHANGED
|
@@ -140,6 +140,7 @@ The `expectType` utility allows you to make assertions about types at compile ti
|
|
|
140
140
|
import { expectType } from 'ts-data-forge';
|
|
141
141
|
|
|
142
142
|
type User = { id: number; name: string };
|
|
143
|
+
|
|
143
144
|
type Admin = { id: number; name: string; role: 'admin' };
|
|
144
145
|
|
|
145
146
|
// Assert that Admin extends User
|
|
@@ -201,7 +202,9 @@ const handleStatus = (status: Status, data?: string): string =>
|
|
|
201
202
|
});
|
|
202
203
|
|
|
203
204
|
assert(handleStatus('loading') === 'Please wait...');
|
|
205
|
+
|
|
204
206
|
assert(handleStatus('success', 'Hello') === 'Data: Hello');
|
|
207
|
+
|
|
205
208
|
assert(handleStatus('error') === 'An error occurred');
|
|
206
209
|
|
|
207
210
|
// Pattern matching with Result
|
|
@@ -209,6 +212,7 @@ const processResult = (result: Result<number, string>): string =>
|
|
|
209
212
|
Result.isOk(result) ? `Success: ${result.value}` : `Error: ${result.value}`;
|
|
210
213
|
|
|
211
214
|
assert(processResult(Result.ok(42)) === 'Success: 42');
|
|
215
|
+
|
|
212
216
|
assert(processResult(Result.err('Failed')) === 'Error: Failed');
|
|
213
217
|
```
|
|
214
218
|
|
|
@@ -221,33 +225,41 @@ import { Num } from 'ts-data-forge';
|
|
|
221
225
|
|
|
222
226
|
// Basic conversions
|
|
223
227
|
assert(Num.from('123') === 123);
|
|
228
|
+
|
|
224
229
|
assert(Number.isNaN(Num.from('abc')));
|
|
225
230
|
|
|
226
231
|
// Range checking
|
|
227
232
|
const inRange = Num.isInRange(0, 10);
|
|
228
233
|
|
|
229
234
|
assert(inRange(5));
|
|
235
|
+
|
|
230
236
|
assert(inRange(0)); // (inclusive lower bound)
|
|
237
|
+
|
|
231
238
|
assert(!inRange(10)); // (exclusive upper bound)
|
|
232
239
|
|
|
233
240
|
// Clamping values
|
|
234
241
|
const clamp = Num.clamp(0, 100);
|
|
235
242
|
|
|
236
243
|
assert(clamp(150) === 100);
|
|
244
|
+
|
|
237
245
|
assert(clamp(-10) === 0);
|
|
238
246
|
|
|
239
247
|
// Rounding utilities
|
|
240
248
|
const round2 = Num.round(2);
|
|
241
249
|
|
|
242
250
|
assert(round2(3.141_59) === 3.14);
|
|
251
|
+
|
|
243
252
|
assert(Num.roundAt(3.141_59, 3) === 3.142);
|
|
253
|
+
|
|
244
254
|
assert(Num.roundToInt(3.7) === 4);
|
|
245
255
|
|
|
246
256
|
// Type guards
|
|
247
257
|
const value = 5; // example value
|
|
258
|
+
|
|
248
259
|
if (Num.isNonZero(value)) {
|
|
249
260
|
// value is guaranteed to be non-zero
|
|
250
261
|
const result = Num.div(10, value); // Safe division
|
|
262
|
+
|
|
251
263
|
assert(result === 2);
|
|
252
264
|
}
|
|
253
265
|
```
|
|
@@ -272,13 +284,19 @@ import {
|
|
|
272
284
|
|
|
273
285
|
// Basic branded types
|
|
274
286
|
const integer = asInt(42); // Int - any integer
|
|
287
|
+
|
|
275
288
|
const unsigned = asUint(42); // Uint - non-negative integer
|
|
289
|
+
|
|
276
290
|
const finite = asFiniteNumber(3.14); // FiniteNumber - finite floating-point
|
|
291
|
+
|
|
277
292
|
const safeInt = asSafeInt(42); // SafeInt - integer in safe range
|
|
278
293
|
|
|
279
294
|
assert(integer === 42);
|
|
295
|
+
|
|
280
296
|
assert(unsigned === 42);
|
|
297
|
+
|
|
281
298
|
assert(finite === 3.14);
|
|
299
|
+
|
|
282
300
|
assert(safeInt === 42);
|
|
283
301
|
|
|
284
302
|
// This line would cause a runtime error:
|
|
@@ -288,29 +306,41 @@ assert.throw(() => {
|
|
|
288
306
|
|
|
289
307
|
// Range-constrained types (16-bit, 32-bit)
|
|
290
308
|
const int16 = asInt16(1000); // Int16: [-32768, 32767]
|
|
309
|
+
|
|
291
310
|
const uint32 = asUint32(3_000_000_000); // Uint32: [0, 4294967295]
|
|
311
|
+
|
|
292
312
|
assert(int16 === 1000);
|
|
313
|
+
|
|
293
314
|
assert(uint32 === 3_000_000_000);
|
|
294
315
|
|
|
295
316
|
// Non-zero and positive variants
|
|
296
317
|
const nonZeroInt = asNonZeroInt(5); // NonZeroInt - excludes zero
|
|
318
|
+
|
|
297
319
|
const positiveInt = asPositiveInt(10); // PositiveInt - excludes zero and negatives
|
|
320
|
+
|
|
298
321
|
assert(nonZeroInt === 5);
|
|
322
|
+
|
|
299
323
|
assert(positiveInt === 10);
|
|
300
324
|
|
|
301
325
|
// Type-safe arithmetic with automatic clamping
|
|
302
326
|
const sum = Int16.add(int16, asInt16(2000)); // Int16 (3000)
|
|
327
|
+
|
|
303
328
|
const clamped = Int16.clamp(100_000); // Int16 (32767 - clamped to MAX_VALUE)
|
|
329
|
+
|
|
304
330
|
assert(sum === 3000);
|
|
331
|
+
|
|
305
332
|
assert(clamped === 32_767);
|
|
306
333
|
|
|
307
334
|
// Safe division with non-zero types
|
|
308
335
|
const ratio = NonZeroInt.div(asNonZeroInt(10), nonZeroInt); // No division by zero risk
|
|
336
|
+
|
|
309
337
|
assert(ratio === 2);
|
|
310
338
|
|
|
311
339
|
// Random generation within type constraints
|
|
312
340
|
const randomInt16 = Int16.random(); // Int16 (random value in valid range)
|
|
341
|
+
|
|
313
342
|
assert(-32_768 <= randomInt16);
|
|
343
|
+
|
|
314
344
|
assert(randomInt16 <= 32_767);
|
|
315
345
|
```
|
|
316
346
|
|
|
@@ -332,6 +362,7 @@ assert(sum === 20);
|
|
|
332
362
|
if (Arr.isArrayAtLeastLength(numbers, 2)) {
|
|
333
363
|
// numbers is now guaranteed to have at least 2 elements
|
|
334
364
|
expectType<typeof numbers, readonly [number, number, ...number[]]>('=');
|
|
365
|
+
|
|
335
366
|
assert(numbers[1] === 2); // Safe access to index 1
|
|
336
367
|
}
|
|
337
368
|
|
|
@@ -347,9 +378,11 @@ assert.deepStrictEqual(unique, [1, 2, 3, 4, 5]);
|
|
|
347
378
|
|
|
348
379
|
// Array creation
|
|
349
380
|
const zeros: readonly [0, 0, 0, 0, 0] = Arr.zeros(5);
|
|
381
|
+
|
|
350
382
|
assert.deepStrictEqual(zeros, [0, 0, 0, 0, 0]);
|
|
351
383
|
|
|
352
384
|
const range: readonly [1, 2, 3] = Arr.range(1, 4);
|
|
385
|
+
|
|
353
386
|
assert.deepStrictEqual(range, [1, 2, 3]);
|
|
354
387
|
|
|
355
388
|
const people = [
|
|
@@ -360,10 +393,12 @@ const people = [
|
|
|
360
393
|
|
|
361
394
|
// Find maximum by property
|
|
362
395
|
const oldestPerson = Arr.maxBy(people, (person) => person.age);
|
|
396
|
+
|
|
363
397
|
assert.deepStrictEqual(
|
|
364
398
|
oldestPerson,
|
|
365
399
|
Optional.some({ name: 'Charlie', age: 35 } as const),
|
|
366
400
|
);
|
|
401
|
+
|
|
367
402
|
if (Optional.isSome(oldestPerson)) {
|
|
368
403
|
assert(oldestPerson.value.name === 'Charlie');
|
|
369
404
|
}
|
|
@@ -378,21 +413,27 @@ import { Arr, IMap, ISet, Optional } from 'ts-data-forge';
|
|
|
378
413
|
|
|
379
414
|
// IMap usage - immutable operations
|
|
380
415
|
const originalMap = IMap.create<string, number>([]);
|
|
416
|
+
|
|
381
417
|
const mapWithOne = originalMap.set('one', 1);
|
|
418
|
+
|
|
382
419
|
const mapWithTwo = mapWithOne.set('two', 2);
|
|
383
420
|
|
|
384
421
|
// Original map is unchanged
|
|
385
422
|
assert(originalMap.size === 0);
|
|
423
|
+
|
|
386
424
|
assert.deepStrictEqual(mapWithTwo.get('one'), Optional.some(1));
|
|
387
425
|
|
|
388
426
|
assert(!mapWithTwo.has('three'));
|
|
389
427
|
|
|
390
428
|
// Using pipe for fluent updates
|
|
391
429
|
const sequence = Arr.seq(10); // [0, 1, 2, ..., 9]
|
|
430
|
+
|
|
392
431
|
const pairs = sequence.map(
|
|
393
432
|
(i) => [i, i.toString()] as readonly [number, string],
|
|
394
433
|
);
|
|
434
|
+
|
|
395
435
|
const skipped = Arr.skip(pairs, 1); // [[1, "1"], ..., [9, "9"]]
|
|
436
|
+
|
|
396
437
|
const idMap = IMap.create<number, string>(skipped);
|
|
397
438
|
|
|
398
439
|
assert(idMap.size === 9);
|
|
@@ -408,10 +449,13 @@ assert(idMapUpdated.size === 9);
|
|
|
408
449
|
|
|
409
450
|
// ISet usage
|
|
410
451
|
const originalSet = ISet.create<number>([]);
|
|
452
|
+
|
|
411
453
|
const setWithItems = originalSet.add(1).add(2).add(1); // Duplicate ignored
|
|
412
454
|
|
|
413
455
|
assert(originalSet.size === 0); // (unchanged)
|
|
456
|
+
|
|
414
457
|
assert(setWithItems.has(1));
|
|
458
|
+
|
|
415
459
|
assert(setWithItems.size === 2);
|
|
416
460
|
```
|
|
417
461
|
|
|
@@ -431,6 +475,7 @@ const processData = (data: unknown): string | undefined => {
|
|
|
431
475
|
) {
|
|
432
476
|
return `Hello, ${data.name}!`;
|
|
433
477
|
}
|
|
478
|
+
|
|
434
479
|
return undefined;
|
|
435
480
|
};
|
|
436
481
|
|
|
@@ -444,7 +489,9 @@ if (isNonNullObject(value)) {
|
|
|
444
489
|
|
|
445
490
|
// Example usage
|
|
446
491
|
assert(processData({ name: 'Alice' }) === 'Hello, Alice!');
|
|
492
|
+
|
|
447
493
|
assert(processData({ age: 30 }) === undefined);
|
|
494
|
+
|
|
448
495
|
assert(processData('not an object') === undefined);
|
|
449
496
|
```
|
|
450
497
|
|
|
@@ -457,6 +504,7 @@ import { range } from 'ts-data-forge';
|
|
|
457
504
|
|
|
458
505
|
// Traditional for loop using range
|
|
459
506
|
const mut_values: number[] = [];
|
|
507
|
+
|
|
460
508
|
for (const i of range(0, 5)) {
|
|
461
509
|
mut_values.push(i);
|
|
462
510
|
}
|
|
@@ -465,13 +513,16 @@ assert.deepStrictEqual(mut_values, [0, 1, 2, 3, 4]);
|
|
|
465
513
|
|
|
466
514
|
// Create arrays from ranges
|
|
467
515
|
const numbers = Array.from(range(1, 4));
|
|
468
|
-
|
|
516
|
+
|
|
517
|
+
const squares = Array.from(range(1, 6), (x) => x ** 2);
|
|
469
518
|
|
|
470
519
|
assert.deepStrictEqual(numbers, [1, 2, 3]);
|
|
520
|
+
|
|
471
521
|
assert.deepStrictEqual(squares, [1, 4, 9, 16, 25]);
|
|
472
522
|
|
|
473
523
|
// Step ranges
|
|
474
524
|
const mut_stepValues: number[] = [];
|
|
525
|
+
|
|
475
526
|
for (const i of range(0, 10, 2)) {
|
|
476
527
|
mut_stepValues.push(i);
|
|
477
528
|
}
|
|
@@ -484,15 +535,12 @@ assert.deepStrictEqual(mut_stepValues, [0, 2, 4, 6, 8]);
|
|
|
484
535
|
Safely work with readonly types when interfacing with mutable APIs.
|
|
485
536
|
|
|
486
537
|
```tsx
|
|
538
|
+
import { Autocomplete, TextField } from '@mui/material';
|
|
539
|
+
import { produce } from 'immer';
|
|
487
540
|
import type * as React from 'react';
|
|
488
541
|
import { castMutable } from 'ts-data-forge';
|
|
489
542
|
|
|
490
543
|
// Example: Material-UI Autocomplete
|
|
491
|
-
import { Autocomplete, TextField } from '@mui/material';
|
|
492
|
-
|
|
493
|
-
// Immer.js example
|
|
494
|
-
import { produce } from 'immer';
|
|
495
|
-
|
|
496
544
|
export const SomeComponent: React.FC = () => (
|
|
497
545
|
<Autocomplete
|
|
498
546
|
options={castMutable(readonlyOptions)}
|
|
@@ -539,6 +587,7 @@ const updatedState = produce(initialState, (draft) => {
|
|
|
539
587
|
});
|
|
540
588
|
|
|
541
589
|
assert.deepStrictEqual(initialState.items, ['item1', 'item2']);
|
|
590
|
+
|
|
542
591
|
assert.deepStrictEqual(updatedState.items, ['newItem1', 'newItem2']);
|
|
543
592
|
```
|
|
544
593
|
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
*
|
|
6
6
|
* ```ts
|
|
7
7
|
* const emptyZeros = Arr.zeros(0);
|
|
8
|
+
*
|
|
8
9
|
* const threeZeros = Arr.zeros(3);
|
|
9
10
|
*
|
|
10
11
|
* assert.deepStrictEqual(emptyZeros, []);
|
|
12
|
+
*
|
|
11
13
|
* assert.deepStrictEqual(threeZeros, [0, 0, 0]);
|
|
12
14
|
* ```
|
|
13
15
|
*/
|
|
@@ -19,9 +21,11 @@ export declare const zeros: <N extends SizeType.ArgArr>(len: N) => N extends Sma
|
|
|
19
21
|
*
|
|
20
22
|
* ```ts
|
|
21
23
|
* const emptySeq = Arr.seq(0);
|
|
24
|
+
*
|
|
22
25
|
* const firstFive = Arr.seq(5);
|
|
23
26
|
*
|
|
24
27
|
* assert.deepStrictEqual(emptySeq, []);
|
|
28
|
+
*
|
|
25
29
|
* assert.deepStrictEqual(firstFive, [0, 1, 2, 3, 4]);
|
|
26
30
|
* ```
|
|
27
31
|
*/
|
|
@@ -33,9 +37,11 @@ export declare const seq: <N extends SizeType.ArgArr>(len: N) => N extends Small
|
|
|
33
37
|
*
|
|
34
38
|
* ```ts
|
|
35
39
|
* const threeOnes = Arr.create(3, 1);
|
|
40
|
+
*
|
|
36
41
|
* const emptyStrings = Arr.create(0, 'Ada');
|
|
37
42
|
*
|
|
38
43
|
* assert.deepStrictEqual(threeOnes, [1, 1, 1]);
|
|
44
|
+
*
|
|
39
45
|
* assert.deepStrictEqual(emptyStrings, []);
|
|
40
46
|
* ```
|
|
41
47
|
*/
|
|
@@ -54,7 +60,9 @@ export declare const newArray: <const V, N extends SizeType.ArgArr>(len: N, init
|
|
|
54
60
|
* ```ts
|
|
55
61
|
* const numbers = Arr.generate(function* () {
|
|
56
62
|
* yield 1;
|
|
63
|
+
*
|
|
57
64
|
* yield 2;
|
|
65
|
+
*
|
|
58
66
|
* yield 3;
|
|
59
67
|
* });
|
|
60
68
|
*
|
|
@@ -70,7 +78,9 @@ export declare const generate: <T>(generatorFn: () => Generator<T, void, unknown
|
|
|
70
78
|
* ```ts
|
|
71
79
|
* const values = await Arr.generateAsync(async function* () {
|
|
72
80
|
* yield 'Ada';
|
|
81
|
+
*
|
|
73
82
|
* await Promise.resolve();
|
|
83
|
+
*
|
|
74
84
|
* yield 'Lovelace';
|
|
75
85
|
* });
|
|
76
86
|
*
|
|
@@ -85,9 +95,11 @@ export declare const generateAsync: <T>(generatorFn: () => AsyncGenerator<T, voi
|
|
|
85
95
|
*
|
|
86
96
|
* ```ts
|
|
87
97
|
* const original = [{ id: 1 }, { id: 2 }] as const;
|
|
98
|
+
*
|
|
88
99
|
* const cloned = Arr.copy(original);
|
|
89
100
|
*
|
|
90
101
|
* assert.deepStrictEqual(cloned, original);
|
|
102
|
+
*
|
|
91
103
|
* assert.notStrictEqual(cloned, original);
|
|
92
104
|
* ```
|
|
93
105
|
*/
|
|
@@ -103,9 +115,11 @@ type RangeList<S extends SmallUint, E extends SmallUint> = BoolOr<IsUnion<S>, Is
|
|
|
103
115
|
*
|
|
104
116
|
* ```ts
|
|
105
117
|
* const ascending = Arr.range(asUint32(1), asUint32(5));
|
|
118
|
+
*
|
|
106
119
|
* const empty = Arr.range(asUint32(2), asUint32(2));
|
|
107
120
|
*
|
|
108
121
|
* assert.deepStrictEqual(ascending, [1, 2, 3, 4]);
|
|
122
|
+
*
|
|
109
123
|
* assert.deepStrictEqual(empty, []);
|
|
110
124
|
* ```
|
|
111
125
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-utils-creation.d.mts","sourceRoot":"","sources":["../../../src/array/impl/array-utils-creation.mts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"array-utils-creation.d.mts","sourceRoot":"","sources":["../../../src/array/impl/array-utils-creation.mts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,SAAS,QAAQ,CAAC,MAAM,EAC7C,KAAK,CAAC,KACL,CAAC,SAAS,SAAS,GAClB,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,GACnB,CAAC,SAAS,QAAQ,CAAC,cAAc,GAC/B,aAAa,CAAC,CAAC,CAAC,GAChB,SAAS,CAAC,EAEiC,CAAC;AAElD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,GAAG,GAAI,CAAC,SAAS,QAAQ,CAAC,MAAM,EAC3C,KAAK,CAAC,KAC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AAE,KAAG,EAEtC,CAAC;AAEjC,KAAK,EAAE,GAAG,QAAQ,CAAC;KAChB,CAAC,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC;CAC3B,CAAC,CAAC;AAEH,KAAK,SAAS,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,SAAS,IACrD,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACvC,SAAS,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAC5C,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAkB3B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,SAAS,EAC5D,KAAK,EAAE,CAAC,EACR,GAAG,EAAE,CAAC,EACN,IAAI,CAAC,EAAE,CAAC,GACP,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEnB,wBAAgB,KAAK,CACnB,KAAK,EAAE,oBAAoB,EAC3B,GAAG,EAAE,oBAAoB,EACzB,IAAI,CAAC,EAAE,2BAA2B,GACjC,SAAS,QAAQ,EAAE,CAAC;AAEvB,wBAAgB,KAAK,CACnB,KAAK,EAAE,mBAAmB,EAC1B,GAAG,EAAE,mBAAmB,EACxB,IAAI,CAAC,EAAE,0BAA0B,GAChC,SAAS,OAAO,EAAE,CAAC"}
|
|
@@ -7,9 +7,11 @@ import { range as range$1 } from '../../iterator/range.mjs';
|
|
|
7
7
|
*
|
|
8
8
|
* ```ts
|
|
9
9
|
* const emptyZeros = Arr.zeros(0);
|
|
10
|
+
*
|
|
10
11
|
* const threeZeros = Arr.zeros(3);
|
|
11
12
|
*
|
|
12
13
|
* assert.deepStrictEqual(emptyZeros, []);
|
|
14
|
+
*
|
|
13
15
|
* assert.deepStrictEqual(threeZeros, [0, 0, 0]);
|
|
14
16
|
* ```
|
|
15
17
|
*/
|
|
@@ -23,9 +25,11 @@ Array.from({ length: len }).fill(0);
|
|
|
23
25
|
*
|
|
24
26
|
* ```ts
|
|
25
27
|
* const emptySeq = Arr.seq(0);
|
|
28
|
+
*
|
|
26
29
|
* const firstFive = Arr.seq(5);
|
|
27
30
|
*
|
|
28
31
|
* assert.deepStrictEqual(emptySeq, []);
|
|
32
|
+
*
|
|
29
33
|
* assert.deepStrictEqual(firstFive, [0, 1, 2, 3, 4]);
|
|
30
34
|
* ```
|
|
31
35
|
*/
|
|
@@ -39,9 +43,11 @@ Array.from({ length: len }, (_, i) => i);
|
|
|
39
43
|
*
|
|
40
44
|
* ```ts
|
|
41
45
|
* const threeOnes = Arr.create(3, 1);
|
|
46
|
+
*
|
|
42
47
|
* const emptyStrings = Arr.create(0, 'Ada');
|
|
43
48
|
*
|
|
44
49
|
* assert.deepStrictEqual(threeOnes, [1, 1, 1]);
|
|
50
|
+
*
|
|
45
51
|
* assert.deepStrictEqual(emptyStrings, []);
|
|
46
52
|
* ```
|
|
47
53
|
*/
|
|
@@ -62,7 +68,9 @@ const newArray = create;
|
|
|
62
68
|
* ```ts
|
|
63
69
|
* const numbers = Arr.generate(function* () {
|
|
64
70
|
* yield 1;
|
|
71
|
+
*
|
|
65
72
|
* yield 2;
|
|
73
|
+
*
|
|
66
74
|
* yield 3;
|
|
67
75
|
* });
|
|
68
76
|
*
|
|
@@ -78,7 +86,9 @@ const generate = (generatorFn) => Array.from(generatorFn());
|
|
|
78
86
|
* ```ts
|
|
79
87
|
* const values = await Arr.generateAsync(async function* () {
|
|
80
88
|
* yield 'Ada';
|
|
89
|
+
*
|
|
81
90
|
* await Promise.resolve();
|
|
91
|
+
*
|
|
82
92
|
* yield 'Lovelace';
|
|
83
93
|
* });
|
|
84
94
|
*
|
|
@@ -93,9 +103,11 @@ const generateAsync = (generatorFn) => Array.fromAsync(generatorFn());
|
|
|
93
103
|
*
|
|
94
104
|
* ```ts
|
|
95
105
|
* const original = [{ id: 1 }, { id: 2 }] as const;
|
|
106
|
+
*
|
|
96
107
|
* const cloned = Arr.copy(original);
|
|
97
108
|
*
|
|
98
109
|
* assert.deepStrictEqual(cloned, original);
|
|
110
|
+
*
|
|
99
111
|
* assert.notStrictEqual(cloned, original);
|
|
100
112
|
* ```
|
|
101
113
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-utils-creation.mjs","sources":["../../../src/array/impl/array-utils-creation.mts"],"sourcesContent":[null],"names":["rangeIterator"],"mappings":";;AAGA
|
|
1
|
+
{"version":3,"file":"array-utils-creation.mjs","sources":["../../../src/array/impl/array-utils-creation.mts"],"sourcesContent":[null],"names":["rangeIterator"],"mappings":";;AAGA;;;;;;;;;;;;;;AAcG;AACI,MAAM,KAAK,GAAG,CACnB,GAAM;AAMN;AACA,KAAK,CAAC,IAAI,CAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AAEvC;;;;;;;;;;;;;;AAcG;AACI,MAAM,GAAG,GAAG,CACjB,GAAM;AAMN;AACA,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;AAEzC;;;;;;;;;;;;;;AAcG;MACU,MAAM,GAAG,CACpB,GAAM,EACN,IAAO;AAMP;AACA,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,MAAM,IAAI;AAErD;;;;AAIG;AACI,MAAM,QAAQ,GAAG;AAExB;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,QAAQ,GAAG,CACtB,WAA8C,KAC7B,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE;AAE3C;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,aAAa,GAAG,CAC3B,WAAmD,KACzB,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE;AAEzD;;;;;;;;;;;;;;AAcG;AACI,MAAM,IAAI,GAAG,CAAsC,KAAS;AACjE;AACA,KAAK,CAAC,KAAK;AA4DP,SAAU,KAAK,CACnB,KAA0B,EAC1B,GAAwB,EACxB,OAAmC,CAAC,EAAA;AAEpC,IAAA,OAAO,KAAK,CAAC,IAAI,CAACA,OAAa,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AACpD;;;;"}
|
|
@@ -7,11 +7,15 @@
|
|
|
7
7
|
* const letters: readonly string[] = ['a', 'b', 'c'];
|
|
8
8
|
*
|
|
9
9
|
* const two = Arr.at(letters, 1);
|
|
10
|
+
*
|
|
10
11
|
* const last = Arr.at(-1)(letters);
|
|
12
|
+
*
|
|
11
13
|
* const missing = Arr.at(letters, 5);
|
|
12
14
|
*
|
|
13
15
|
* assert.deepStrictEqual(two, Optional.some('b'));
|
|
16
|
+
*
|
|
14
17
|
* assert.deepStrictEqual(last, Optional.some('c'));
|
|
18
|
+
*
|
|
15
19
|
* assert.deepStrictEqual(missing, Optional.none);
|
|
16
20
|
* ```
|
|
17
21
|
*/
|
|
@@ -24,12 +28,15 @@ export declare function at(index: SizeType.ArgArrWithNegative): <E>(array: reado
|
|
|
24
28
|
*
|
|
25
29
|
* ```ts
|
|
26
30
|
* const users = [{ id: 1 }, { id: 2 }];
|
|
31
|
+
*
|
|
27
32
|
* const empty: { id: number }[] = [];
|
|
28
33
|
*
|
|
29
34
|
* const first = Arr.head(users);
|
|
35
|
+
*
|
|
30
36
|
* const none = Arr.head(empty);
|
|
31
37
|
*
|
|
32
38
|
* assert.deepStrictEqual(first, Optional.some({ id: 1 }));
|
|
39
|
+
*
|
|
33
40
|
* assert.deepStrictEqual(none, Optional.none);
|
|
34
41
|
* ```
|
|
35
42
|
*/
|
|
@@ -41,12 +48,15 @@ export declare const head: <const Ar extends readonly unknown[]>(array: Ar) => A
|
|
|
41
48
|
*
|
|
42
49
|
* ```ts
|
|
43
50
|
* const queue = ['first', 'second'];
|
|
51
|
+
*
|
|
44
52
|
* const emptyQueue: string[] = [];
|
|
45
53
|
*
|
|
46
54
|
* const lastValue = Arr.last(queue);
|
|
55
|
+
*
|
|
47
56
|
* const none = Arr.last(emptyQueue);
|
|
48
57
|
*
|
|
49
58
|
* assert.deepStrictEqual(lastValue, Optional.some('second'));
|
|
59
|
+
*
|
|
50
60
|
* assert.deepStrictEqual(none, Optional.none);
|
|
51
61
|
* ```
|
|
52
62
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-utils-element-access.d.mts","sourceRoot":"","sources":["../../../src/array/impl/array-utils-element-access.mts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"array-utils-element-access.d.mts","sourceRoot":"","sources":["../../../src/array/impl/array-utils-element-access.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,EAAE,CAAC,KAAK,CAAC,EAAE,SAAS,SAAS,OAAO,EAAE,EACpD,KAAK,EAAE,EAAE,EACT,KAAK,EAAE,yBAAyB,CAAC,EAAE,CAAC,GACnC,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;AAIxB,wBAAgB,EAAE,CAChB,KAAK,EAAE,QAAQ,CAAC,kBAAkB,GACjC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC;AA4B3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,IAAI,GAAI,KAAK,CAAC,EAAE,SAAS,SAAS,OAAO,EAAE,EACtD,OAAO,EAAE,KACR,EAAE,SAAS,SAAS,EAAE,GACrB,IAAI,GACJ,EAAE,SAAS,SAAS,CAAC,MAAM,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,GACzC,IAAI,CAAC,CAAC,CAAC,GACP,EAAE,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAC/B,IAAI,CAAC,CAAC,CAAC,GACP,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,CAEiD,CAAC;AAE7E;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,IAAI,GAAI,KAAK,CAAC,EAAE,SAAS,SAAS,OAAO,EAAE,EACtD,OAAO,EAAE,KACR,EAAE,SAAS,SAAS,EAAE,GACrB,IAAI,GACJ,EAAE,SAAS,SAAS,CAAC,GAAG,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC,GACzC,IAAI,CAAC,CAAC,CAAC,GACP,EAAE,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAC/B,IAAI,CAAC,CAAC,CAAC,GACP,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,CAEkD,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,KAAK,SAhDS,EAAE,SAAS,SAAS,OAAO,EAAE,SAC/C,EAAE,KACR,EAAE,SAAS,SAAS,EAAE,GACrB,IAAI,GACJ,EAAE,SAAS,SAAS,CAAC,MAAM,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,GACzC,IAAI,CAAC,CAAC,CAAC,GACP,EAAE,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAC/B,IAAI,CAAC,CAAC,CAAC,GACP,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,CAwCF,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { none } from '../../functional/optional/impl/optional-none.mjs';
|
|
2
2
|
import { some } from '../../functional/optional/impl/optional-some.mjs';
|
|
3
3
|
import { pipe } from '../../functional/pipe.mjs';
|
|
4
|
+
import '@sindresorhus/is';
|
|
4
5
|
|
|
5
6
|
function at(...args) {
|
|
6
7
|
switch (args.length) {
|
|
@@ -24,12 +25,15 @@ function at(...args) {
|
|
|
24
25
|
*
|
|
25
26
|
* ```ts
|
|
26
27
|
* const users = [{ id: 1 }, { id: 2 }];
|
|
28
|
+
*
|
|
27
29
|
* const empty: { id: number }[] = [];
|
|
28
30
|
*
|
|
29
31
|
* const first = Arr.head(users);
|
|
32
|
+
*
|
|
30
33
|
* const none = Arr.head(empty);
|
|
31
34
|
*
|
|
32
35
|
* assert.deepStrictEqual(first, Optional.some({ id: 1 }));
|
|
36
|
+
*
|
|
33
37
|
* assert.deepStrictEqual(none, Optional.none);
|
|
34
38
|
* ```
|
|
35
39
|
*/
|
|
@@ -43,12 +47,15 @@ const head = (array) =>
|
|
|
43
47
|
*
|
|
44
48
|
* ```ts
|
|
45
49
|
* const queue = ['first', 'second'];
|
|
50
|
+
*
|
|
46
51
|
* const emptyQueue: string[] = [];
|
|
47
52
|
*
|
|
48
53
|
* const lastValue = Arr.last(queue);
|
|
54
|
+
*
|
|
49
55
|
* const none = Arr.last(emptyQueue);
|
|
50
56
|
*
|
|
51
57
|
* assert.deepStrictEqual(lastValue, Optional.some('second'));
|
|
58
|
+
*
|
|
52
59
|
* assert.deepStrictEqual(none, Optional.none);
|
|
53
60
|
* ```
|
|
54
61
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-utils-element-access.mjs","sources":["../../../src/array/impl/array-utils-element-access.mts"],"sourcesContent":[null],"names":["index","Optional.none","Optional.some"],"mappings":"
|
|
1
|
+
{"version":3,"file":"array-utils-element-access.mjs","sources":["../../../src/array/impl/array-utils-element-access.mts"],"sourcesContent":[null],"names":["index","Optional.none","Optional.some"],"mappings":";;;;;AAkCM,SAAU,EAAE,CAChB,GAAG,IAE8C,EAAA;AAEjD,IAAA,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,KAAK,EAAEA,OAAK,CAAC,GAAG,IAAI;AAE3B,YAAA,OAAO,IAAI,CAACA,OAAK,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,GAAGA,OAAK,GAAGA,OAAK,CAAC,CAAC,GAAG,CACvD,CAAC,eAAe,KACd,eAAe,GAAG,CAAC,IAAI,eAAe,IAAI,KAAK,CAAC;kBAC5CC;AACF;oBACEC,IAAa,CAAC,KAAK,CAAC,eAAe,CAAE,CAAC,CAC7C,CAAC,KAAK;QACT;QAEA,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI;YAEpB,OAAO,CAAC,KAAK,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;QACpC;;AAEJ;AAEA;;;;;;;;;;;;;;;;;;AAkBG;AACI,MAAM,IAAI,GAAG,CAClB,KAAS;AAQT;AACA,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,GAAGD,IAAa,GAAGC,IAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAElE;;;;;;;;;;;;;;;;;;AAkBG;AACI,MAAM,IAAI,GAAG,CAClB,KAAS;AAQT;AACA,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,GAAGD,IAAa,GAAGC,IAAa,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAEnE;;;;AAIG;AACI,MAAM,KAAK,GAAG;;;;"}
|
|
@@ -26,12 +26,14 @@ export declare function set<const V>(index: SizeType.ArgArr, newValue: V): <cons
|
|
|
26
26
|
* const temperatures: number[] = [20, 21, 22];
|
|
27
27
|
*
|
|
28
28
|
* const increased = Arr.toUpdated(temperatures, 1, (value) => value + 5);
|
|
29
|
+
*
|
|
29
30
|
* const incrementLast = Arr.toUpdated<number>(
|
|
30
31
|
* 2,
|
|
31
32
|
* (value) => value + 1,
|
|
32
33
|
* )(temperatures);
|
|
33
34
|
*
|
|
34
35
|
* assert.deepStrictEqual(increased, [20, 26, 22]);
|
|
36
|
+
*
|
|
35
37
|
* assert.deepStrictEqual(incrementLast, [20, 21, 23]);
|
|
36
38
|
* ```
|
|
37
39
|
*/
|
|
@@ -50,9 +52,11 @@ export declare function toUpdated<E, const V = E>(index: SizeType.ArgArr, update
|
|
|
50
52
|
* const numbers = [1, 2, 4] as const;
|
|
51
53
|
*
|
|
52
54
|
* const withThree = Arr.toInserted(numbers, 2, 3);
|
|
55
|
+
*
|
|
53
56
|
* const appendFive = Arr.toInserted(3, 5)(numbers);
|
|
54
57
|
*
|
|
55
58
|
* assert.deepStrictEqual(withThree, [1, 2, 3, 4]);
|
|
59
|
+
*
|
|
56
60
|
* assert.deepStrictEqual(appendFive, [1, 2, 4, 5]);
|
|
57
61
|
* ```
|
|
58
62
|
*/
|
|
@@ -68,9 +72,11 @@ type CastToNumber<T> = T extends number ? T : never;
|
|
|
68
72
|
* const letters = ['a', 'b', 'c', 'd'] as const;
|
|
69
73
|
*
|
|
70
74
|
* const withoutSecond = Arr.toRemoved(letters, 1);
|
|
75
|
+
*
|
|
71
76
|
* const withoutFirstCurried = Arr.toRemoved(0)(letters);
|
|
72
77
|
*
|
|
73
78
|
* assert.deepStrictEqual(withoutSecond, ['a', 'c', 'd']);
|
|
79
|
+
*
|
|
74
80
|
* assert.deepStrictEqual(withoutFirstCurried, ['b', 'c', 'd']);
|
|
75
81
|
* ```
|
|
76
82
|
*/
|
|
@@ -85,9 +91,11 @@ export declare function toRemoved(index: SizeType.ArgArrWithNegative): <E>(array
|
|
|
85
91
|
* const base = [1, 2] as const;
|
|
86
92
|
*
|
|
87
93
|
* const appended = Arr.toPushed(base, 3);
|
|
94
|
+
*
|
|
88
95
|
* const appendedCurried = Arr.toPushed(4)(base);
|
|
89
96
|
*
|
|
90
97
|
* assert.deepStrictEqual(appended, [1, 2, 3]);
|
|
98
|
+
*
|
|
91
99
|
* assert.deepStrictEqual(appendedCurried, [1, 2, 4]);
|
|
92
100
|
* ```
|
|
93
101
|
*/
|
|
@@ -102,9 +110,11 @@ export declare function toPushed<const V>(newValue: V): <const Ar extends readon
|
|
|
102
110
|
* const base = [2, 3] as const;
|
|
103
111
|
*
|
|
104
112
|
* const prefixed = Arr.toUnshifted(base, 1);
|
|
113
|
+
*
|
|
105
114
|
* const prefixedCurried = Arr.toUnshifted(0)(base);
|
|
106
115
|
*
|
|
107
116
|
* assert.deepStrictEqual(prefixed, [1, 2, 3]);
|
|
117
|
+
*
|
|
108
118
|
* assert.deepStrictEqual(prefixedCurried, [0, 2, 3]);
|
|
109
119
|
* ```
|
|
110
120
|
*/
|
|
@@ -119,9 +129,11 @@ export declare function toUnshifted<const V>(newValue: V): <const Ar extends rea
|
|
|
119
129
|
* const base = [1, 2, 3];
|
|
120
130
|
*
|
|
121
131
|
* const filled = Arr.toFilled(base, 0);
|
|
132
|
+
*
|
|
122
133
|
* const filledCurried = Arr.toFilled('x')(base);
|
|
123
134
|
*
|
|
124
135
|
* assert.deepStrictEqual(filled, [0, 0, 0]);
|
|
136
|
+
*
|
|
125
137
|
* assert.deepStrictEqual(filledCurried, ['x', 'x', 'x']);
|
|
126
138
|
* ```
|
|
127
139
|
*/
|
|
@@ -136,9 +148,11 @@ export declare function toFilled<const V>(value: V): <const Ar extends readonly
|
|
|
136
148
|
* const base = [0, 1, 2, 3, 4];
|
|
137
149
|
*
|
|
138
150
|
* const filledMiddle = Arr.toRangeFilled(base, 9, [1, 4]);
|
|
151
|
+
*
|
|
139
152
|
* const filledPrefix = Arr.toRangeFilled(8, [0, 2])(base);
|
|
140
153
|
*
|
|
141
154
|
* assert.deepStrictEqual(filledMiddle, [0, 9, 9, 9, 4]);
|
|
155
|
+
*
|
|
142
156
|
* assert.deepStrictEqual(filledPrefix, [8, 8, 2, 3, 4]);
|
|
143
157
|
* ```
|
|
144
158
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-utils-modification.d.mts","sourceRoot":"","sources":["../../../src/array/impl/array-utils-modification.mts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,GAAG,CAAC,KAAK,CAAC,EAAE,SAAS,SAAS,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,EAC3E,KAAK,EAAE,EAAE,EACT,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29,6 +29,7 @@ import '../../number/enum/uint8.mjs';
|
|
|
29
29
|
import '../../number/num.mjs';
|
|
30
30
|
import '../../number/refined-number-utils.mjs';
|
|
31
31
|
import { castMutable } from '../../others/cast-mutable.mjs';
|
|
32
|
+
import '@sindresorhus/is';
|
|
32
33
|
import { create, copy } from './array-utils-creation.mjs';
|
|
33
34
|
|
|
34
35
|
function set(...args) {
|