ts-data-forge 5.0.1 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +101 -50
- package/dist/array/impl/array-utils-creation.d.mts +14 -0
- package/dist/array/impl/array-utils-creation.d.mts.map +1 -1
- package/dist/array/impl/array-utils-creation.mjs +12 -0
- package/dist/array/impl/array-utils-creation.mjs.map +1 -1
- package/dist/array/impl/array-utils-element-access.d.mts +10 -0
- package/dist/array/impl/array-utils-element-access.d.mts.map +1 -1
- package/dist/array/impl/array-utils-element-access.mjs +6 -0
- package/dist/array/impl/array-utils-element-access.mjs.map +1 -1
- package/dist/array/impl/array-utils-modification.d.mts +14 -0
- package/dist/array/impl/array-utils-modification.d.mts.map +1 -1
- package/dist/array/impl/array-utils-modification.mjs.map +1 -1
- package/dist/array/impl/array-utils-reducing-value.d.mts +34 -10
- package/dist/array/impl/array-utils-reducing-value.d.mts.map +1 -1
- package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -1
- package/dist/array/impl/array-utils-search.d.mts +34 -4
- package/dist/array/impl/array-utils-search.d.mts.map +1 -1
- package/dist/array/impl/array-utils-search.mjs.map +1 -1
- package/dist/array/impl/array-utils-set-op.d.mts +20 -7
- package/dist/array/impl/array-utils-set-op.d.mts.map +1 -1
- package/dist/array/impl/array-utils-set-op.mjs +20 -7
- package/dist/array/impl/array-utils-set-op.mjs.map +1 -1
- package/dist/array/impl/array-utils-size.d.mts +5 -2
- package/dist/array/impl/array-utils-size.d.mts.map +1 -1
- package/dist/array/impl/array-utils-size.mjs +5 -2
- package/dist/array/impl/array-utils-size.mjs.map +1 -1
- package/dist/array/impl/array-utils-slice-clamped.d.mts +2 -0
- package/dist/array/impl/array-utils-slice-clamped.d.mts.map +1 -1
- package/dist/array/impl/array-utils-slice-clamped.mjs.map +1 -1
- package/dist/array/impl/array-utils-slicing.d.mts +17 -2
- package/dist/array/impl/array-utils-slicing.d.mts.map +1 -1
- package/dist/array/impl/array-utils-slicing.mjs +9 -2
- package/dist/array/impl/array-utils-slicing.mjs.map +1 -1
- package/dist/array/impl/array-utils-transformation.d.mts +27 -0
- package/dist/array/impl/array-utils-transformation.d.mts.map +1 -1
- package/dist/array/impl/array-utils-transformation.mjs +6 -0
- package/dist/array/impl/array-utils-transformation.mjs.map +1 -1
- package/dist/array/impl/array-utils-validation.d.mts +35 -18
- package/dist/array/impl/array-utils-validation.d.mts.map +1 -1
- package/dist/array/impl/array-utils-validation.mjs +25 -14
- package/dist/array/impl/array-utils-validation.mjs.map +1 -1
- package/dist/collections/imap-mapped.mjs.map +1 -1
- package/dist/collections/imap.d.mts +35 -15
- package/dist/collections/imap.d.mts.map +1 -1
- package/dist/collections/imap.mjs +5 -3
- package/dist/collections/imap.mjs.map +1 -1
- package/dist/collections/iset-mapped.d.mts +46 -19
- package/dist/collections/iset-mapped.d.mts.map +1 -1
- package/dist/collections/iset-mapped.mjs +9 -2
- package/dist/collections/iset-mapped.mjs.map +1 -1
- package/dist/collections/iset.d.mts +48 -19
- package/dist/collections/iset.d.mts.map +1 -1
- package/dist/collections/iset.mjs +9 -2
- package/dist/collections/iset.mjs.map +1 -1
- package/dist/collections/queue.d.mts +65 -25
- package/dist/collections/queue.d.mts.map +1 -1
- package/dist/collections/queue.mjs +13 -5
- package/dist/collections/queue.mjs.map +1 -1
- package/dist/collections/stack.d.mts +60 -25
- package/dist/collections/stack.d.mts.map +1 -1
- package/dist/collections/stack.mjs +12 -5
- package/dist/collections/stack.mjs.map +1 -1
- package/dist/entry-point.mjs +1 -1
- package/dist/functional/match.d.mts +1 -1
- package/dist/functional/match.d.mts.map +1 -1
- package/dist/functional/match.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-expect-to-be.d.mts +3 -2
- package/dist/functional/optional/impl/optional-expect-to-be.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-filter.d.mts +3 -0
- package/dist/functional/optional/impl/optional-filter.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-filter.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-flat-map.d.mts +2 -0
- package/dist/functional/optional/impl/optional-flat-map.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-flat-map.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-from-nullable.d.mts +2 -0
- package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-from-nullable.mjs +2 -0
- package/dist/functional/optional/impl/optional-from-nullable.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-is-none.d.mts +1 -1
- package/dist/functional/optional/impl/optional-is-none.mjs +1 -1
- package/dist/functional/optional/impl/optional-is-optional.d.mts +4 -2
- package/dist/functional/optional/impl/optional-is-optional.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-is-optional.mjs +4 -2
- package/dist/functional/optional/impl/optional-is-optional.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-is-some.d.mts +2 -1
- package/dist/functional/optional/impl/optional-is-some.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-is-some.mjs +2 -1
- package/dist/functional/optional/impl/optional-is-some.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-map.d.mts +2 -0
- package/dist/functional/optional/impl/optional-map.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-map.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-none.d.mts +4 -2
- package/dist/functional/optional/impl/optional-none.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-none.mjs +4 -2
- package/dist/functional/optional/impl/optional-none.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-or-else.d.mts +4 -0
- package/dist/functional/optional/impl/optional-or-else.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-or-else.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-some.d.mts +5 -3
- package/dist/functional/optional/impl/optional-some.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-some.mjs +4 -2
- package/dist/functional/optional/impl/optional-some.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-to-nullable.d.mts +4 -2
- package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-to-nullable.mjs +4 -2
- package/dist/functional/optional/impl/optional-to-nullable.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap-or.d.mts +7 -4
- package/dist/functional/optional/impl/optional-unwrap-or.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap-or.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap-throw.d.mts +2 -1
- package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap-throw.mjs +2 -1
- package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap.d.mts +4 -2
- package/dist/functional/optional/impl/optional-unwrap.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-unwrap.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-zip.d.mts +3 -1
- package/dist/functional/optional/impl/optional-zip.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-zip.mjs +3 -1
- package/dist/functional/optional/impl/optional-zip.mjs.map +1 -1
- package/dist/functional/pipe.d.mts +2 -2
- package/dist/functional/result/impl/result-err.d.mts +4 -2
- package/dist/functional/result/impl/result-err.d.mts.map +1 -1
- package/dist/functional/result/impl/result-err.mjs +3 -1
- package/dist/functional/result/impl/result-err.mjs.map +1 -1
- package/dist/functional/result/impl/result-expect-to-be.d.mts +3 -2
- package/dist/functional/result/impl/result-expect-to-be.d.mts.map +1 -1
- package/dist/functional/result/impl/result-expect-to-be.mjs.map +1 -1
- package/dist/functional/result/impl/result-flat-map.d.mts +5 -0
- package/dist/functional/result/impl/result-flat-map.d.mts.map +1 -1
- package/dist/functional/result/impl/result-flat-map.mjs.map +1 -1
- package/dist/functional/result/impl/result-fold.d.mts +4 -0
- package/dist/functional/result/impl/result-fold.d.mts.map +1 -1
- package/dist/functional/result/impl/result-fold.mjs.map +1 -1
- package/dist/functional/result/impl/result-from-promise.d.mts +4 -1
- package/dist/functional/result/impl/result-from-promise.d.mts.map +1 -1
- package/dist/functional/result/impl/result-from-promise.mjs +4 -1
- package/dist/functional/result/impl/result-from-promise.mjs.map +1 -1
- package/dist/functional/result/impl/result-from-throwable.d.mts +3 -1
- package/dist/functional/result/impl/result-from-throwable.d.mts.map +1 -1
- package/dist/functional/result/impl/result-from-throwable.mjs +3 -1
- package/dist/functional/result/impl/result-from-throwable.mjs.map +1 -1
- package/dist/functional/result/impl/result-is-err.d.mts +4 -2
- package/dist/functional/result/impl/result-is-err.d.mts.map +1 -1
- package/dist/functional/result/impl/result-is-err.mjs +4 -2
- package/dist/functional/result/impl/result-is-err.mjs.map +1 -1
- package/dist/functional/result/impl/result-is-ok.d.mts +4 -2
- package/dist/functional/result/impl/result-is-ok.d.mts.map +1 -1
- package/dist/functional/result/impl/result-is-ok.mjs +4 -2
- package/dist/functional/result/impl/result-is-ok.mjs.map +1 -1
- package/dist/functional/result/impl/result-is-result.d.mts +7 -3
- package/dist/functional/result/impl/result-is-result.d.mts.map +1 -1
- package/dist/functional/result/impl/result-is-result.mjs +7 -3
- package/dist/functional/result/impl/result-is-result.mjs.map +1 -1
- package/dist/functional/result/impl/result-map-err.d.mts +3 -0
- package/dist/functional/result/impl/result-map-err.d.mts.map +1 -1
- package/dist/functional/result/impl/result-map-err.mjs.map +1 -1
- package/dist/functional/result/impl/result-map.d.mts +4 -0
- package/dist/functional/result/impl/result-map.d.mts.map +1 -1
- package/dist/functional/result/impl/result-map.mjs.map +1 -1
- package/dist/functional/result/impl/result-ok.d.mts +4 -2
- package/dist/functional/result/impl/result-ok.d.mts.map +1 -1
- package/dist/functional/result/impl/result-ok.mjs +3 -1
- package/dist/functional/result/impl/result-ok.mjs.map +1 -1
- package/dist/functional/result/impl/result-or-else.d.mts +4 -0
- package/dist/functional/result/impl/result-or-else.d.mts.map +1 -1
- package/dist/functional/result/impl/result-or-else.mjs.map +1 -1
- package/dist/functional/result/impl/result-swap.d.mts +2 -0
- package/dist/functional/result/impl/result-swap.d.mts.map +1 -1
- package/dist/functional/result/impl/result-swap.mjs +2 -0
- package/dist/functional/result/impl/result-swap.mjs.map +1 -1
- package/dist/functional/result/impl/result-to-optional.d.mts +2 -0
- package/dist/functional/result/impl/result-to-optional.d.mts.map +1 -1
- package/dist/functional/result/impl/result-to-optional.mjs +2 -0
- package/dist/functional/result/impl/result-to-optional.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err-or.d.mts +7 -4
- package/dist/functional/result/impl/result-unwrap-err-or.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err-or.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err-throw.d.mts +3 -1
- package/dist/functional/result/impl/result-unwrap-err-throw.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err-throw.mjs +3 -1
- package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err.d.mts +3 -2
- package/dist/functional/result/impl/result-unwrap-err.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-err.mjs +3 -2
- package/dist/functional/result/impl/result-unwrap-err.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-ok-or.d.mts +7 -4
- package/dist/functional/result/impl/result-unwrap-ok-or.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-ok-or.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-ok.d.mts +3 -2
- package/dist/functional/result/impl/result-unwrap-ok.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-ok.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-throw.d.mts +3 -1
- package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +1 -1
- package/dist/functional/result/impl/result-unwrap-throw.mjs +3 -1
- package/dist/functional/result/impl/result-unwrap-throw.mjs.map +1 -1
- package/dist/functional/result/impl/result-zip.d.mts +3 -1
- package/dist/functional/result/impl/result-zip.d.mts.map +1 -1
- package/dist/functional/result/impl/result-zip.mjs +3 -1
- package/dist/functional/result/impl/result-zip.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-err.d.mts +3 -2
- package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-err.mjs +2 -1
- package/dist/functional/ternary-result/impl/ternary-result-err.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts +4 -0
- package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-fold.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts +3 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs +3 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts +3 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs +3 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts +7 -3
- package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +7 -3
- package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts +3 -0
- package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts +3 -0
- package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map.d.mts +6 -0
- package/dist/functional/ternary-result/impl/ternary-result-map.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-ok.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs +1 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs +2 -0
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-warn.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts +4 -0
- package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-zip.mjs +4 -0
- package/dist/functional/ternary-result/impl/ternary-result-zip.mjs.map +1 -1
- package/dist/globals.d.mts +12 -1
- package/dist/guard/has-key.d.mts +6 -3
- package/dist/guard/has-key.d.mts.map +1 -1
- package/dist/guard/has-key.mjs +2 -2
- package/dist/guard/index.mjs +1 -1
- package/dist/guard/is-record.d.mts +31 -0
- package/dist/guard/is-record.d.mts.map +1 -1
- package/dist/guard/is-record.mjs +32 -1
- package/dist/guard/is-record.mjs.map +1 -1
- package/dist/guard/is-type.d.mts +3 -0
- package/dist/guard/is-type.d.mts.map +1 -1
- package/dist/guard/is-type.mjs +3 -0
- package/dist/guard/is-type.mjs.map +1 -1
- package/dist/guard/key-is-in.d.mts +3 -2
- package/dist/guard/key-is-in.d.mts.map +1 -1
- package/dist/guard/key-is-in.mjs +3 -2
- package/dist/guard/key-is-in.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/iterator/range.d.mts +4 -0
- package/dist/iterator/range.d.mts.map +1 -1
- package/dist/iterator/range.mjs +1 -0
- package/dist/iterator/range.mjs.map +1 -1
- package/dist/json/json.d.mts +42 -21
- package/dist/json/json.d.mts.map +1 -1
- package/dist/json/json.mjs +42 -21
- package/dist/json/json.mjs.map +1 -1
- package/dist/number/branded-types/int.d.mts +33 -19
- package/dist/number/branded-types/int.d.mts.map +1 -1
- package/dist/number/branded-types/int.mjs +33 -19
- package/dist/number/branded-types/int.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-safe-int.mjs +2 -2
- package/dist/number/branded-types/positive-int.d.mts +34 -20
- package/dist/number/branded-types/positive-int.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int.mjs +34 -20
- package/dist/number/branded-types/positive-int.mjs.map +1 -1
- package/dist/number/branded-types/positive-safe-int.d.mts +47 -26
- package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/positive-safe-int.mjs +48 -27
- package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/safe-int.d.mts +48 -27
- package/dist/number/branded-types/safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/safe-int.mjs +50 -29
- package/dist/number/branded-types/safe-int.mjs.map +1 -1
- package/dist/number/branded-types/safe-uint.mjs +1 -1
- package/dist/number/branded-types/uint.d.mts +31 -19
- package/dist/number/branded-types/uint.d.mts.map +1 -1
- package/dist/number/branded-types/uint.mjs +31 -19
- package/dist/number/branded-types/uint.mjs.map +1 -1
- package/dist/number/num.d.mts +29 -20
- package/dist/number/num.d.mts.map +1 -1
- package/dist/number/num.mjs +24 -17
- package/dist/number/num.mjs.map +1 -1
- package/dist/number/refined-number-utils.d.mts +33 -11
- package/dist/number/refined-number-utils.d.mts.map +1 -1
- package/dist/number/refined-number-utils.mjs +33 -11
- package/dist/number/refined-number-utils.mjs.map +1 -1
- package/dist/object/object.d.mts +12 -3
- package/dist/object/object.d.mts.map +1 -1
- package/dist/object/object.mjs +10 -3
- package/dist/object/object.mjs.map +1 -1
- package/dist/others/map-nullable.mjs.map +1 -1
- package/dist/others/tuple.d.mts +14 -3
- package/dist/others/tuple.d.mts.map +1 -1
- package/dist/others/tuple.mjs +14 -3
- package/dist/others/tuple.mjs.map +1 -1
- package/dist/others/unknown-to-string.d.mts.map +1 -1
- package/dist/others/unknown-to-string.mjs.map +1 -1
- package/dist/promise/promise.d.mts +8 -4
- package/dist/promise/promise.d.mts.map +1 -1
- package/dist/promise/promise.mjs +8 -4
- package/dist/promise/promise.mjs.map +1 -1
- package/package.json +26 -28
- package/src/array/impl/array-utils-creation.mts +20 -0
- package/src/array/impl/array-utils-creation.test.mts +72 -1
- package/src/array/impl/array-utils-element-access.mts +13 -0
- package/src/array/impl/array-utils-element-access.test.mts +36 -15
- package/src/array/impl/array-utils-iterators.test.mts +17 -0
- package/src/array/impl/array-utils-modification.mts +78 -19
- package/src/array/impl/array-utils-modification.test.mts +75 -0
- package/src/array/impl/array-utils-overload-type-error.test.mts +19 -0
- package/src/array/impl/array-utils-reducing-value.mts +61 -16
- package/src/array/impl/array-utils-reducing-value.test.mts +107 -25
- package/src/array/impl/array-utils-search.mts +57 -4
- package/src/array/impl/array-utils-search.test.mts +61 -10
- package/src/array/impl/array-utils-set-op.mts +26 -7
- package/src/array/impl/array-utils-set-op.test.mts +129 -13
- package/src/array/impl/array-utils-size.mts +5 -2
- package/src/array/impl/array-utils-size.test.mts +1 -0
- package/src/array/impl/array-utils-slice-clamped.mts +7 -0
- package/src/array/impl/array-utils-slice-clamped.test.mts +20 -0
- package/src/array/impl/array-utils-slicing.mts +29 -2
- package/src/array/impl/array-utils-slicing.test.mts +57 -0
- package/src/array/impl/array-utils-transformation.mts +58 -0
- package/src/array/impl/array-utils-transformation.test.mts +115 -3
- package/src/array/impl/array-utils-validation.mts +41 -18
- package/src/array/impl/array-utils-validation.test.mts +176 -78
- package/src/array/impl/array.test.mts +18 -6
- package/src/collections/imap-mapped.mts +11 -0
- package/src/collections/imap-mapped.test.mts +86 -18
- package/src/collections/imap.mts +47 -15
- package/src/collections/imap.test.mts +137 -31
- package/src/collections/iset-mapped.mts +54 -19
- package/src/collections/iset-mapped.test.mts +163 -52
- package/src/collections/iset.mts +53 -19
- package/src/collections/iset.test.mts +323 -130
- package/src/collections/queue.mts +78 -25
- package/src/collections/queue.test.mts +65 -35
- package/src/collections/stack.mts +67 -25
- package/src/collections/stack.test.mts +59 -15
- package/src/functional/match.mts +17 -1
- package/src/functional/match.test.mts +2 -0
- package/src/functional/optional/impl/optional-expect-to-be.mts +5 -2
- package/src/functional/optional/impl/optional-filter.mts +6 -0
- package/src/functional/optional/impl/optional-flat-map.mts +4 -0
- package/src/functional/optional/impl/optional-from-nullable.mts +2 -0
- package/src/functional/optional/impl/optional-is-none.mts +1 -1
- package/src/functional/optional/impl/optional-is-optional.mts +4 -2
- package/src/functional/optional/impl/optional-is-some.mts +2 -1
- package/src/functional/optional/impl/optional-map.mts +5 -0
- package/src/functional/optional/impl/optional-none.mts +4 -2
- package/src/functional/optional/impl/optional-or-else.mts +6 -0
- package/src/functional/optional/impl/optional-some.mts +5 -3
- package/src/functional/optional/impl/optional-to-nullable.mts +4 -2
- package/src/functional/optional/impl/optional-unwrap-or.mts +9 -4
- package/src/functional/optional/impl/optional-unwrap-throw.mts +2 -1
- package/src/functional/optional/impl/optional-unwrap.mts +4 -2
- package/src/functional/optional/impl/optional-zip.mts +3 -1
- package/src/functional/optional.test.mts +126 -54
- package/src/functional/pipe.mts +2 -2
- package/src/functional/pipe.test.mts +7 -4
- package/src/functional/result/impl/result-err.mts +4 -2
- package/src/functional/result/impl/result-expect-to-be.mts +5 -2
- package/src/functional/result/impl/result-flat-map.mts +7 -0
- package/src/functional/result/impl/result-fold.mts +6 -0
- package/src/functional/result/impl/result-from-promise.mts +4 -1
- package/src/functional/result/impl/result-from-throwable.mts +5 -1
- package/src/functional/result/impl/result-is-err.mts +4 -2
- package/src/functional/result/impl/result-is-ok.mts +4 -2
- package/src/functional/result/impl/result-is-result.mts +7 -3
- package/src/functional/result/impl/result-map-err.mts +5 -0
- package/src/functional/result/impl/result-map.mts +6 -0
- package/src/functional/result/impl/result-ok.mts +4 -2
- package/src/functional/result/impl/result-or-else.mts +6 -0
- package/src/functional/result/impl/result-swap.mts +2 -0
- package/src/functional/result/impl/result-to-optional.mts +2 -0
- package/src/functional/result/impl/result-unwrap-err-or.mts +9 -4
- package/src/functional/result/impl/result-unwrap-err-throw.mts +3 -1
- package/src/functional/result/impl/result-unwrap-err.mts +3 -2
- package/src/functional/result/impl/result-unwrap-ok-or.mts +9 -4
- package/src/functional/result/impl/result-unwrap-ok.mts +4 -2
- package/src/functional/result/impl/result-unwrap-throw.mts +3 -1
- package/src/functional/result/impl/result-zip.mts +3 -1
- package/src/functional/result.test.mts +182 -152
- package/src/functional/ternary-result/impl/ternary-result-err.mts +3 -2
- package/src/functional/ternary-result/impl/ternary-result-expect-to-be.mts +4 -0
- package/src/functional/ternary-result/impl/ternary-result-flat-map.mts +7 -0
- package/src/functional/ternary-result/impl/ternary-result-fold.mts +5 -0
- package/src/functional/ternary-result/impl/ternary-result-from-promise.mts +3 -1
- package/src/functional/ternary-result/impl/ternary-result-from-throwable.mts +4 -1
- package/src/functional/ternary-result/impl/ternary-result-is-ok.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-is-ternary-result.mts +7 -3
- package/src/functional/ternary-result/impl/ternary-result-is-warn.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-map-err.mts +6 -0
- package/src/functional/ternary-result/impl/ternary-result-map-warn.mts +6 -0
- package/src/functional/ternary-result/impl/ternary-result-map.mts +9 -0
- package/src/functional/ternary-result/impl/ternary-result-ok.mts +1 -1
- package/src/functional/ternary-result/impl/ternary-result-or-else.mts +5 -0
- package/src/functional/ternary-result/impl/ternary-result-to-optional.mts +2 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts +5 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-err.mts +2 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mts +5 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-ok.mts +3 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-throw.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mts +5 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mts +1 -0
- package/src/functional/ternary-result/impl/ternary-result-unwrap-warn.mts +2 -0
- package/src/functional/ternary-result/impl/ternary-result-warn.mts +4 -1
- package/src/functional/ternary-result/impl/ternary-result-zip.mts +4 -0
- package/src/functional/ternary-result.test.mts +99 -8
- package/src/globals.d.mts +12 -1
- package/src/guard/has-key.mts +8 -5
- package/src/guard/has-key.test.mts +9 -5
- package/src/guard/is-error.test.mts +143 -0
- package/src/guard/is-non-empty-string.test.mts +44 -24
- package/src/guard/is-non-null-object.test.mts +45 -26
- package/src/guard/is-primitive.test.mts +51 -28
- package/src/guard/is-record.mts +34 -0
- package/src/guard/is-record.test.mts +28 -7
- package/src/guard/is-type.mts +3 -0
- package/src/guard/is-type.test.mts +285 -155
- package/src/guard/key-is-in.mts +3 -2
- package/src/guard/key-is-in.test.mts +2 -2
- package/src/iterator/range.mts +9 -0
- package/src/json/json.mts +50 -21
- package/src/json/json.test.mts +224 -176
- package/src/number/branded-types/finite-number.test.mts +51 -11
- package/src/number/branded-types/int.mts +33 -19
- package/src/number/branded-types/int.test.mts +56 -14
- package/src/number/branded-types/int16.test.mts +63 -16
- package/src/number/branded-types/int32.test.mts +63 -16
- package/src/number/branded-types/non-negative-finite-number.test.mts +52 -12
- package/src/number/branded-types/non-negative-int16.test.mts +59 -16
- package/src/number/branded-types/non-negative-int32.test.mts +59 -16
- package/src/number/branded-types/non-zero-finite-number.test.mts +65 -14
- package/src/number/branded-types/non-zero-int.test.mts +72 -19
- package/src/number/branded-types/non-zero-int16.test.mts +60 -16
- package/src/number/branded-types/non-zero-int32.test.mts +60 -16
- package/src/number/branded-types/non-zero-safe-int.mts +2 -2
- package/src/number/branded-types/non-zero-safe-int.test.mts +85 -23
- package/src/number/branded-types/non-zero-uint16.test.mts +53 -16
- package/src/number/branded-types/non-zero-uint32.test.mts +53 -16
- package/src/number/branded-types/positive-finite-number.test.mts +59 -14
- package/src/number/branded-types/positive-int.mts +34 -20
- package/src/number/branded-types/positive-int.test.mts +64 -17
- package/src/number/branded-types/positive-int16.test.mts +50 -15
- package/src/number/branded-types/positive-int32.test.mts +50 -15
- package/src/number/branded-types/positive-safe-int.mts +48 -27
- package/src/number/branded-types/positive-safe-int.test.mts +68 -19
- package/src/number/branded-types/positive-uint16.test.mts +53 -16
- package/src/number/branded-types/positive-uint32.test.mts +53 -16
- package/src/number/branded-types/safe-int.mts +50 -29
- package/src/number/branded-types/safe-int.test.mts +70 -18
- package/src/number/branded-types/safe-uint.mts +1 -1
- package/src/number/branded-types/safe-uint.test.mts +65 -17
- package/src/number/branded-types/uint.mts +31 -19
- package/src/number/branded-types/uint.test.mts +58 -15
- package/src/number/branded-types/uint16.test.mts +56 -15
- package/src/number/branded-types/uint32.test.mts +56 -15
- package/src/number/enum/int8.test.mts +7 -1
- package/src/number/enum/uint8.test.mts +7 -1
- package/src/number/num.mts +32 -21
- package/src/number/num.test.mts +88 -26
- package/src/number/refined-number-utils.mts +38 -13
- package/src/object/object.mts +19 -3
- package/src/object/object.test.mts +16 -6
- package/src/others/cast-mutable.test.mts +8 -1
- package/src/others/cast-readonly.test.mts +21 -4
- package/src/others/if-then.test.mts +40 -24
- package/src/others/map-nullable.mts +3 -0
- package/src/others/map-nullable.test.mts +27 -0
- package/src/others/memoize-function.test.mts +41 -0
- package/src/others/tuple.mts +14 -3
- package/src/others/unknown-to-string.mts +2 -0
- package/src/others/unknown-to-string.test.mts +10 -0
- package/src/promise/promise.mts +8 -4
- package/src/promise/promise.test.mts +8 -13
|
@@ -59,7 +59,7 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
59
59
|
*
|
|
60
60
|
* const set = ISetMapped.create<Point, string>(points, toKey, fromKey);
|
|
61
61
|
*
|
|
62
|
-
* assert(set.size === 2);
|
|
62
|
+
* assert.isTrue(set.size === 2);
|
|
63
63
|
* ```
|
|
64
64
|
*/
|
|
65
65
|
size: SizeType.Arr;
|
|
@@ -77,14 +77,16 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
77
77
|
* const fromKey = (key: string) => JSON.parse(key) as Point;
|
|
78
78
|
*
|
|
79
79
|
* const empty = ISetMapped.create<Point, string>([], toKey, fromKey);
|
|
80
|
+
*
|
|
80
81
|
* const points = ISetMapped.create<Point, string>(
|
|
81
82
|
* [{ x: 1, tag: 'a' }],
|
|
82
83
|
* toKey,
|
|
83
84
|
* fromKey,
|
|
84
85
|
* );
|
|
85
86
|
*
|
|
86
|
-
* assert.
|
|
87
|
-
*
|
|
87
|
+
* assert.isTrue(empty.isEmpty);
|
|
88
|
+
*
|
|
89
|
+
* assert.isFalse(points.isEmpty);
|
|
88
90
|
* ```
|
|
89
91
|
*/
|
|
90
92
|
isEmpty: boolean;
|
|
@@ -107,8 +109,9 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
107
109
|
* fromKey,
|
|
108
110
|
* );
|
|
109
111
|
*
|
|
110
|
-
* assert.
|
|
111
|
-
*
|
|
112
|
+
* assert.isTrue(set.has({ x: 1, tag: 'a' }));
|
|
113
|
+
*
|
|
114
|
+
* assert.isFalse(set.has({ x: 2, tag: 'b' }));
|
|
112
115
|
* ```
|
|
113
116
|
*
|
|
114
117
|
* @param key The element to check.
|
|
@@ -138,12 +141,14 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
138
141
|
* );
|
|
139
142
|
*
|
|
140
143
|
* const allEven = set.every((point) => point.x % 2 === 0);
|
|
144
|
+
*
|
|
141
145
|
* const narrowed = set.every(
|
|
142
146
|
* (point): point is Readonly<{ x: 2 | 4; tag: 'even' }> => point.x % 2 === 0,
|
|
143
147
|
* );
|
|
144
148
|
*
|
|
145
|
-
* assert.
|
|
146
|
-
*
|
|
149
|
+
* assert.isTrue(allEven);
|
|
150
|
+
*
|
|
151
|
+
* assert.isTrue(narrowed);
|
|
147
152
|
* ```
|
|
148
153
|
*
|
|
149
154
|
* @param predicate A function to test each element.
|
|
@@ -182,8 +187,9 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
182
187
|
* fromKey,
|
|
183
188
|
* );
|
|
184
189
|
*
|
|
185
|
-
* assert.
|
|
186
|
-
*
|
|
190
|
+
* assert.isTrue(set.some((point) => point.x > 4));
|
|
191
|
+
*
|
|
192
|
+
* assert.isFalse(set.some((point) => point.x > 10));
|
|
187
193
|
* ```
|
|
188
194
|
*
|
|
189
195
|
* @param predicate A function to test each element.
|
|
@@ -211,13 +217,15 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
211
217
|
* );
|
|
212
218
|
*
|
|
213
219
|
* const withNew = base.add({ x: 2, tag: 'b' });
|
|
220
|
+
*
|
|
214
221
|
* const unchanged = base.add({ x: 1, tag: 'a' });
|
|
215
222
|
*
|
|
216
223
|
* assert.deepStrictEqual(Array.from(withNew), [
|
|
217
224
|
* { x: 1, tag: 'a' },
|
|
218
225
|
* { x: 2, tag: 'b' },
|
|
219
226
|
* ]);
|
|
220
|
-
*
|
|
227
|
+
*
|
|
228
|
+
* assert.isTrue(unchanged === base);
|
|
221
229
|
* ```
|
|
222
230
|
*
|
|
223
231
|
* @param key The element to add.
|
|
@@ -247,10 +255,12 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
247
255
|
* );
|
|
248
256
|
*
|
|
249
257
|
* const withoutSecond = base.delete({ x: 2, tag: 'b' });
|
|
258
|
+
*
|
|
250
259
|
* const unchanged = base.delete({ x: 3, tag: 'c' });
|
|
251
260
|
*
|
|
252
261
|
* assert.deepStrictEqual(Array.from(withoutSecond), [{ x: 1, tag: 'a' }]);
|
|
253
|
-
*
|
|
262
|
+
*
|
|
263
|
+
* assert.isTrue(unchanged === base);
|
|
254
264
|
* ```
|
|
255
265
|
*
|
|
256
266
|
* @param key The element to delete.
|
|
@@ -292,6 +302,7 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
292
302
|
* { x: 2, tag: 'b' },
|
|
293
303
|
* { x: 3, tag: 'c' },
|
|
294
304
|
* ]);
|
|
305
|
+
*
|
|
295
306
|
* assert.deepStrictEqual(Array.from(base), [
|
|
296
307
|
* { x: 1, tag: 'a' },
|
|
297
308
|
* { x: 2, tag: 'b' },
|
|
@@ -437,6 +448,7 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
437
448
|
* );
|
|
438
449
|
*
|
|
439
450
|
* const collected: Point[] = [];
|
|
451
|
+
*
|
|
440
452
|
* for (const point of set) {
|
|
441
453
|
* collected.push(point);
|
|
442
454
|
* }
|
|
@@ -468,6 +480,7 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
468
480
|
* toKey,
|
|
469
481
|
* fromKey,
|
|
470
482
|
* );
|
|
483
|
+
*
|
|
471
484
|
* const superset = ISetMapped.create<Point, string>(
|
|
472
485
|
* [
|
|
473
486
|
* { x: 1, tag: 'a' },
|
|
@@ -477,8 +490,9 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
477
490
|
* fromKey,
|
|
478
491
|
* );
|
|
479
492
|
*
|
|
480
|
-
* assert.
|
|
481
|
-
*
|
|
493
|
+
* assert.isTrue(subset.isSubsetOf(superset));
|
|
494
|
+
*
|
|
495
|
+
* assert.isFalse(superset.isSubsetOf(subset));
|
|
482
496
|
* ```
|
|
483
497
|
*
|
|
484
498
|
* @param set The other set.
|
|
@@ -507,14 +521,16 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
507
521
|
* toKey,
|
|
508
522
|
* fromKey,
|
|
509
523
|
* );
|
|
524
|
+
*
|
|
510
525
|
* const subset = ISetMapped.create<Point, string>(
|
|
511
526
|
* [{ x: 2, tag: 'b' }],
|
|
512
527
|
* toKey,
|
|
513
528
|
* fromKey,
|
|
514
529
|
* );
|
|
515
530
|
*
|
|
516
|
-
* assert.
|
|
517
|
-
*
|
|
531
|
+
* assert.isTrue(superset.isSupersetOf(subset));
|
|
532
|
+
*
|
|
533
|
+
* assert.isFalse(subset.isSupersetOf(superset));
|
|
518
534
|
* ```
|
|
519
535
|
*
|
|
520
536
|
* @param set The other set.
|
|
@@ -545,6 +561,7 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
545
561
|
* toKey,
|
|
546
562
|
* fromKey,
|
|
547
563
|
* );
|
|
564
|
+
*
|
|
548
565
|
* const right = ISetMapped.create<Point, string>(
|
|
549
566
|
* [{ x: 2, tag: 'b' }],
|
|
550
567
|
* toKey,
|
|
@@ -585,6 +602,7 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
585
602
|
* toKey,
|
|
586
603
|
* fromKey,
|
|
587
604
|
* );
|
|
605
|
+
*
|
|
588
606
|
* const right = ISetMapped.create<Point, string>(
|
|
589
607
|
* [{ x: 2, tag: 'b' }],
|
|
590
608
|
* toKey,
|
|
@@ -618,6 +636,7 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
618
636
|
* toKey,
|
|
619
637
|
* fromKey,
|
|
620
638
|
* );
|
|
639
|
+
*
|
|
621
640
|
* const right = ISetMapped.create<Point, string>(
|
|
622
641
|
* [{ x: 2, tag: 'b' }],
|
|
623
642
|
* toKey,
|
|
@@ -787,8 +806,9 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
787
806
|
*
|
|
788
807
|
* const raw = set.toRawSet();
|
|
789
808
|
*
|
|
790
|
-
* assert.
|
|
791
|
-
*
|
|
809
|
+
* assert.isTrue(is.set(raw));
|
|
810
|
+
*
|
|
811
|
+
* assert.isTrue(raw.has(toKey({ x: 1, tag: 'a' })));
|
|
792
812
|
* ```
|
|
793
813
|
*
|
|
794
814
|
* @returns The raw ReadonlySet instance.
|
|
@@ -907,6 +927,7 @@ export declare namespace ISetMapped {
|
|
|
907
927
|
* toKey,
|
|
908
928
|
* fromKey,
|
|
909
929
|
* );
|
|
930
|
+
*
|
|
910
931
|
* const second = ISetMapped.create<Point, string>(
|
|
911
932
|
* [
|
|
912
933
|
* { x: 2, tag: 'b' },
|
|
@@ -915,14 +936,16 @@ export declare namespace ISetMapped {
|
|
|
915
936
|
* toKey,
|
|
916
937
|
* fromKey,
|
|
917
938
|
* );
|
|
939
|
+
*
|
|
918
940
|
* const third = ISetMapped.create<Point, string>(
|
|
919
941
|
* [{ x: 3, tag: 'c' }],
|
|
920
942
|
* toKey,
|
|
921
943
|
* fromKey,
|
|
922
944
|
* );
|
|
923
945
|
*
|
|
924
|
-
* assert.
|
|
925
|
-
*
|
|
946
|
+
* assert.isTrue(ISetMapped.equal(first, second));
|
|
947
|
+
*
|
|
948
|
+
* assert.isFalse(ISetMapped.equal(first, third));
|
|
926
949
|
* ```
|
|
927
950
|
*
|
|
928
951
|
* @template K The type of the custom elements.
|
|
@@ -954,6 +977,7 @@ export declare namespace ISetMapped {
|
|
|
954
977
|
* toKey,
|
|
955
978
|
* fromKey,
|
|
956
979
|
* );
|
|
980
|
+
*
|
|
957
981
|
* const current = ISetMapped.create<Point, string>(
|
|
958
982
|
* [
|
|
959
983
|
* { x: 2, tag: 'b' },
|
|
@@ -966,6 +990,7 @@ export declare namespace ISetMapped {
|
|
|
966
990
|
* const { added, deleted } = ISetMapped.diff(previous, current);
|
|
967
991
|
*
|
|
968
992
|
* assert.deepStrictEqual(Array.from(added), [{ x: 3, tag: 'c' }]);
|
|
993
|
+
*
|
|
969
994
|
* assert.deepStrictEqual(Array.from(deleted), [{ x: 1, tag: 'a' }]);
|
|
970
995
|
* ```
|
|
971
996
|
*
|
|
@@ -997,6 +1022,7 @@ export declare namespace ISetMapped {
|
|
|
997
1022
|
* toKey,
|
|
998
1023
|
* fromKey,
|
|
999
1024
|
* );
|
|
1025
|
+
*
|
|
1000
1026
|
* const right = ISetMapped.create<Point, string>(
|
|
1001
1027
|
* [{ x: 2, tag: 'b' }],
|
|
1002
1028
|
* toKey,
|
|
@@ -1033,6 +1059,7 @@ export declare namespace ISetMapped {
|
|
|
1033
1059
|
* toKey,
|
|
1034
1060
|
* fromKey,
|
|
1035
1061
|
* );
|
|
1062
|
+
*
|
|
1036
1063
|
* const right = ISetMapped.create<Point, string>(
|
|
1037
1064
|
* [{ x: 2, tag: 'b' }],
|
|
1038
1065
|
* toKey,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iset-mapped.d.mts","sourceRoot":"","sources":["../../src/collections/iset-mapped.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,KAAK,mBAAmB,CAAC,CAAC,EAAE,EAAE,SAAS,aAAa,IAAI,QAAQ,CAAC;IAC/D;;;;;;;OAOG;IACH,KAAK,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;IAI9E;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC;IAEnB
|
|
1
|
+
{"version":3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;;;;OAsCG;IACI,MAAM,YAAY,GAAI,CAAC,EAAE,EAAE,SAAS,aAAa,EACtD,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,EACpB,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,KACnB,UAAU,CAAC,CAAC,EAAE,EAAE,CAAmB,CAAC;IAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACI,MAAM,KAAK,GAAI,CAAC,EAAE,EAAE,SAAS,aAAa,EAC/C,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,EACpB,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,KACnB,UAAU,CAAC,CAAC,EAAE,EAAE,CAAe,CAAC;CACpC"}
|
|
@@ -111,6 +111,7 @@ var ISetMapped;
|
|
|
111
111
|
* toKey,
|
|
112
112
|
* fromKey,
|
|
113
113
|
* );
|
|
114
|
+
*
|
|
114
115
|
* const second = ISetMapped.create<Point, string>(
|
|
115
116
|
* [
|
|
116
117
|
* { x: 2, tag: 'b' },
|
|
@@ -119,14 +120,16 @@ var ISetMapped;
|
|
|
119
120
|
* toKey,
|
|
120
121
|
* fromKey,
|
|
121
122
|
* );
|
|
123
|
+
*
|
|
122
124
|
* const third = ISetMapped.create<Point, string>(
|
|
123
125
|
* [{ x: 3, tag: 'c' }],
|
|
124
126
|
* toKey,
|
|
125
127
|
* fromKey,
|
|
126
128
|
* );
|
|
127
129
|
*
|
|
128
|
-
* assert.
|
|
129
|
-
*
|
|
130
|
+
* assert.isTrue(ISetMapped.equal(first, second));
|
|
131
|
+
*
|
|
132
|
+
* assert.isFalse(ISetMapped.equal(first, third));
|
|
130
133
|
* ```
|
|
131
134
|
*
|
|
132
135
|
* @template K The type of the custom elements.
|
|
@@ -158,6 +161,7 @@ var ISetMapped;
|
|
|
158
161
|
* toKey,
|
|
159
162
|
* fromKey,
|
|
160
163
|
* );
|
|
164
|
+
*
|
|
161
165
|
* const current = ISetMapped.create<Point, string>(
|
|
162
166
|
* [
|
|
163
167
|
* { x: 2, tag: 'b' },
|
|
@@ -170,6 +174,7 @@ var ISetMapped;
|
|
|
170
174
|
* const { added, deleted } = ISetMapped.diff(previous, current);
|
|
171
175
|
*
|
|
172
176
|
* assert.deepStrictEqual(Array.from(added), [{ x: 3, tag: 'c' }]);
|
|
177
|
+
*
|
|
173
178
|
* assert.deepStrictEqual(Array.from(deleted), [{ x: 1, tag: 'a' }]);
|
|
174
179
|
* ```
|
|
175
180
|
*
|
|
@@ -204,6 +209,7 @@ var ISetMapped;
|
|
|
204
209
|
* toKey,
|
|
205
210
|
* fromKey,
|
|
206
211
|
* );
|
|
212
|
+
*
|
|
207
213
|
* const right = ISetMapped.create<Point, string>(
|
|
208
214
|
* [{ x: 2, tag: 'b' }],
|
|
209
215
|
* toKey,
|
|
@@ -240,6 +246,7 @@ var ISetMapped;
|
|
|
240
246
|
* toKey,
|
|
241
247
|
* fromKey,
|
|
242
248
|
* );
|
|
249
|
+
*
|
|
243
250
|
* const right = ISetMapped.create<Point, string>(
|
|
244
251
|
* [{ x: 2, tag: 'b' }],
|
|
245
252
|
* toKey,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iset-mapped.mjs","sources":["../../src/collections/iset-mapped.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"iset-mapped.mjs","sources":["../../src/collections/iset-mapped.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA23BA;AACM,IAAW;AAAjB,CAAA,UAAiB,UAAU,EAAA;AACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDG;AACU,IAAA,UAAA,CAAA,MAAM,GAAG,CACpB,QAAqB,EACrB,KAAmB,EACnB,OAAqB,KACC,IAAI,eAAe,CAAQ,QAAQ,EAAE,KAAK,E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YAEjC,MAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;AAE3B,YAAA,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;QACd;IACF;;IAGA,OAAO,GAAA;QACL,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAClC;;IAGA,QAAQ,GAAA;QACN,OAAO,IAAI,CAAC,IAAI;IAClB;AACD;;;;"}
|
|
@@ -33,7 +33,7 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
33
33
|
* ```ts
|
|
34
34
|
* const set = ISet.create([1, 2, 3]);
|
|
35
35
|
*
|
|
36
|
-
* assert(set.size === 3);
|
|
36
|
+
* assert.isTrue(set.size === 3);
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
39
|
size: SizeType.Arr;
|
|
@@ -44,10 +44,12 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
44
44
|
*
|
|
45
45
|
* ```ts
|
|
46
46
|
* const emptySet = ISet.create<number>([]);
|
|
47
|
+
*
|
|
47
48
|
* const filledSet = ISet.create([1, 2]);
|
|
48
49
|
*
|
|
49
|
-
* assert.
|
|
50
|
-
*
|
|
50
|
+
* assert.isTrue(emptySet.isEmpty);
|
|
51
|
+
*
|
|
52
|
+
* assert.isFalse(filledSet.isEmpty);
|
|
51
53
|
* ```
|
|
52
54
|
*/
|
|
53
55
|
isEmpty: boolean;
|
|
@@ -60,8 +62,9 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
60
62
|
* ```ts
|
|
61
63
|
* const set = ISet.create(['apple', 'banana']);
|
|
62
64
|
*
|
|
63
|
-
* assert.
|
|
64
|
-
*
|
|
65
|
+
* assert.isTrue(set.has('apple'));
|
|
66
|
+
*
|
|
67
|
+
* assert.isFalse(set.has('cherry'));
|
|
65
68
|
* ```
|
|
66
69
|
*
|
|
67
70
|
* @param key The element to check.
|
|
@@ -77,10 +80,12 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
77
80
|
* const numbers = ISet.create([2, 4, 6]);
|
|
78
81
|
*
|
|
79
82
|
* const allEven = numbers.every((value) => value % 2 === 0);
|
|
83
|
+
*
|
|
80
84
|
* const narrowed = numbers.every((value): value is 2 | 4 | 6 => value % 2 === 0);
|
|
81
85
|
*
|
|
82
|
-
* assert.
|
|
83
|
-
*
|
|
86
|
+
* assert.isTrue(allEven);
|
|
87
|
+
*
|
|
88
|
+
* assert.isTrue(narrowed);
|
|
84
89
|
* ```
|
|
85
90
|
*
|
|
86
91
|
* @param predicate A function to test each element.
|
|
@@ -105,8 +110,9 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
105
110
|
* ```ts
|
|
106
111
|
* const numbers = ISet.create([1, 3, 5]);
|
|
107
112
|
*
|
|
108
|
-
* assert.
|
|
109
|
-
*
|
|
113
|
+
* assert.isTrue(numbers.some((value) => value > 4));
|
|
114
|
+
*
|
|
115
|
+
* assert.isFalse(numbers.some((value) => value > 10));
|
|
110
116
|
* ```
|
|
111
117
|
*
|
|
112
118
|
* @param predicate A function to test each element.
|
|
@@ -123,10 +129,12 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
123
129
|
* const base = ISet.create<number>([1, 2]);
|
|
124
130
|
*
|
|
125
131
|
* const withThree = base.add(3);
|
|
132
|
+
*
|
|
126
133
|
* const unchanged = base.add(2);
|
|
127
134
|
*
|
|
128
135
|
* assert.deepStrictEqual(Array.from(withThree), [1, 2, 3]);
|
|
129
|
-
*
|
|
136
|
+
*
|
|
137
|
+
* assert.isTrue(unchanged === base);
|
|
130
138
|
* ```
|
|
131
139
|
*
|
|
132
140
|
* @param key The element to add.
|
|
@@ -142,10 +150,12 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
142
150
|
* const base = ISet.create<number>([1, 2, 3]);
|
|
143
151
|
*
|
|
144
152
|
* const withoutTwo = base.delete(2);
|
|
153
|
+
*
|
|
145
154
|
* const unchanged = base.delete(4);
|
|
146
155
|
*
|
|
147
156
|
* assert.deepStrictEqual(Array.from(withoutTwo), [1, 3]);
|
|
148
|
-
*
|
|
157
|
+
*
|
|
158
|
+
* assert.isTrue(unchanged === base);
|
|
149
159
|
* ```
|
|
150
160
|
*
|
|
151
161
|
* @param key The element to delete.
|
|
@@ -170,6 +180,7 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
170
180
|
* const mutated = base.withMutations(actions);
|
|
171
181
|
*
|
|
172
182
|
* assert.deepStrictEqual(Array.from(mutated), ['b', 'c']);
|
|
183
|
+
*
|
|
173
184
|
* assert.deepStrictEqual(Array.from(base), ['a', 'b']);
|
|
174
185
|
* ```
|
|
175
186
|
*
|
|
@@ -211,11 +222,13 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
211
222
|
* const letters = ISet.create(['apple', 'bee', 'cat']);
|
|
212
223
|
*
|
|
213
224
|
* const shortWords = letters.filter((value) => value.length <= 3);
|
|
225
|
+
*
|
|
214
226
|
* const narrowed = letters.filter(
|
|
215
227
|
* (value): value is 'bee' | 'cat' => value.length === 3,
|
|
216
228
|
* );
|
|
217
229
|
*
|
|
218
230
|
* assert.deepStrictEqual(Array.from(shortWords), ['bee', 'cat']);
|
|
231
|
+
*
|
|
219
232
|
* assert.deepStrictEqual(Array.from(narrowed), ['bee', 'cat']);
|
|
220
233
|
* ```
|
|
221
234
|
*
|
|
@@ -257,10 +270,12 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
257
270
|
*
|
|
258
271
|
* ```ts
|
|
259
272
|
* const subset = ISet.create<number>([1, 2]);
|
|
273
|
+
*
|
|
260
274
|
* const superset = ISet.create<number>([1, 2, 3]);
|
|
261
275
|
*
|
|
262
|
-
* assert.
|
|
263
|
-
*
|
|
276
|
+
* assert.isTrue(subset.isSubsetOf(superset));
|
|
277
|
+
*
|
|
278
|
+
* assert.isFalse(superset.isSubsetOf(subset));
|
|
264
279
|
* ```
|
|
265
280
|
*
|
|
266
281
|
* @param set The other set.
|
|
@@ -275,10 +290,12 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
275
290
|
*
|
|
276
291
|
* ```ts
|
|
277
292
|
* const superset = ISet.create<string>(['a', 'b', 'c']);
|
|
293
|
+
*
|
|
278
294
|
* const subset = ISet.create<string>(['a', 'c']);
|
|
279
295
|
*
|
|
280
|
-
* assert.
|
|
281
|
-
*
|
|
296
|
+
* assert.isTrue(superset.isSupersetOf(subset));
|
|
297
|
+
*
|
|
298
|
+
* assert.isFalse(subset.isSupersetOf(superset));
|
|
282
299
|
* ```
|
|
283
300
|
*
|
|
284
301
|
* @param set The other set.
|
|
@@ -294,6 +311,7 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
294
311
|
*
|
|
295
312
|
* ```ts
|
|
296
313
|
* const all = ISet.create<number>([1, 2, 3, 4]);
|
|
314
|
+
*
|
|
297
315
|
* const toRemove = ISet.create<number>([2, 4]);
|
|
298
316
|
*
|
|
299
317
|
* const difference = all.subtract(toRemove);
|
|
@@ -313,6 +331,7 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
313
331
|
*
|
|
314
332
|
* ```ts
|
|
315
333
|
* const left = ISet.create<string>(['x', 'y']);
|
|
334
|
+
*
|
|
316
335
|
* const right = ISet.create<string>(['y', 'z']);
|
|
317
336
|
*
|
|
318
337
|
* const shared = left.intersect(right);
|
|
@@ -331,6 +350,7 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
331
350
|
*
|
|
332
351
|
* ```ts
|
|
333
352
|
* const numbers = ISet.create([1, 2]);
|
|
353
|
+
*
|
|
334
354
|
* const letters = ISet.create(['a', 'b']);
|
|
335
355
|
*
|
|
336
356
|
* const combined = numbers.union(letters);
|
|
@@ -350,6 +370,7 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
350
370
|
*
|
|
351
371
|
* ```ts
|
|
352
372
|
* const set = ISet.create(['alpha', 'beta']);
|
|
373
|
+
*
|
|
353
374
|
* const collected: string[] = [];
|
|
354
375
|
*
|
|
355
376
|
* for (const value of set) {
|
|
@@ -437,8 +458,9 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
437
458
|
*
|
|
438
459
|
* const raw = set.toRawSet();
|
|
439
460
|
*
|
|
440
|
-
* assert.
|
|
441
|
-
*
|
|
461
|
+
* assert.isTrue(is.set(raw));
|
|
462
|
+
*
|
|
463
|
+
* assert.isTrue(raw.has('alpha'));
|
|
442
464
|
* ```
|
|
443
465
|
*
|
|
444
466
|
* @returns The raw ReadonlySet instance.
|
|
@@ -513,11 +535,14 @@ export declare namespace ISet {
|
|
|
513
535
|
*
|
|
514
536
|
* ```ts
|
|
515
537
|
* const first = ISet.create<number>([1, 2]);
|
|
538
|
+
*
|
|
516
539
|
* const second = ISet.create<number>([2, 1]);
|
|
540
|
+
*
|
|
517
541
|
* const third = ISet.create<number>([1, 3]);
|
|
518
542
|
*
|
|
519
|
-
* assert.
|
|
520
|
-
*
|
|
543
|
+
* assert.isTrue(ISet.equal(first, second));
|
|
544
|
+
*
|
|
545
|
+
* assert.isFalse(ISet.equal(first, third));
|
|
521
546
|
* ```
|
|
522
547
|
*
|
|
523
548
|
* @template K The type of the elements.
|
|
@@ -543,11 +568,13 @@ export declare namespace ISet {
|
|
|
543
568
|
*
|
|
544
569
|
* ```ts
|
|
545
570
|
* const previous = ISet.create<string>(['draft', 'review']);
|
|
571
|
+
*
|
|
546
572
|
* const current = ISet.create<string>(['review', 'published']);
|
|
547
573
|
*
|
|
548
574
|
* const { added, deleted } = ISet.diff(previous, current);
|
|
549
575
|
*
|
|
550
576
|
* assert.deepStrictEqual(Array.from(added), ['published']);
|
|
577
|
+
*
|
|
551
578
|
* assert.deepStrictEqual(Array.from(deleted), ['draft']);
|
|
552
579
|
* ```
|
|
553
580
|
*
|
|
@@ -572,6 +599,7 @@ export declare namespace ISet {
|
|
|
572
599
|
*
|
|
573
600
|
* ```ts
|
|
574
601
|
* const left = ISet.create<number>([1, 2, 3]);
|
|
602
|
+
*
|
|
575
603
|
* const right = ISet.create<number>([2, 4]);
|
|
576
604
|
*
|
|
577
605
|
* const overlap = ISet.intersection(left, right);
|
|
@@ -599,6 +627,7 @@ export declare namespace ISet {
|
|
|
599
627
|
*
|
|
600
628
|
* ```ts
|
|
601
629
|
* const numbers = ISet.create([1, 2]);
|
|
630
|
+
*
|
|
602
631
|
* const words = ISet.create(['one', 'two']);
|
|
603
632
|
*
|
|
604
633
|
* const union = ISet.union(numbers, words);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iset.d.mts","sourceRoot":"","sources":["../../src/collections/iset.mts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,KAAK,aAAa,CAAC,CAAC,SAAS,aAAa,IAAI,QAAQ,CAAC;IAGrD;;;;;;;;;;OAUG;IACH,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC;IAEnB
|
|
1
|
+
{"version":3,"file":"iset.d.mts","sourceRoot":"","sources":["../../src/collections/iset.mts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,KAAK,aAAa,CAAC,CAAC,SAAS,aAAa,IAAI,QAAQ,CAAC;IAGrD;;;;;;;;;;OAUG;IACH,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC;IAEnB;;;;;;;;;;;;;;OAcG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;IAIlD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,KAAK,OAAO,CAAC;IAClD;;;;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OA2BG;IACI,MAAM,KAAK,GAAI,EAAE,SAAS,aAAa,EAAE,EAAE,SAAS,aAAa,EACtE,GAAG,IAAI,CAAC,EAAE,CAAC,EACX,GAAG,IAAI,CAAC,EAAE,CAAC,KACV,IAAI,CAAC,EAAE,GAAG,EAAE,CAAe,CAAC;CAChC"}
|
|
@@ -72,11 +72,14 @@ var ISet;
|
|
|
72
72
|
*
|
|
73
73
|
* ```ts
|
|
74
74
|
* const first = ISet.create<number>([1, 2]);
|
|
75
|
+
*
|
|
75
76
|
* const second = ISet.create<number>([2, 1]);
|
|
77
|
+
*
|
|
76
78
|
* const third = ISet.create<number>([1, 3]);
|
|
77
79
|
*
|
|
78
|
-
* assert.
|
|
79
|
-
*
|
|
80
|
+
* assert.isTrue(ISet.equal(first, second));
|
|
81
|
+
*
|
|
82
|
+
* assert.isFalse(ISet.equal(first, third));
|
|
80
83
|
* ```
|
|
81
84
|
*
|
|
82
85
|
* @template K The type of the elements.
|
|
@@ -102,11 +105,13 @@ var ISet;
|
|
|
102
105
|
*
|
|
103
106
|
* ```ts
|
|
104
107
|
* const previous = ISet.create<string>(['draft', 'review']);
|
|
108
|
+
*
|
|
105
109
|
* const current = ISet.create<string>(['review', 'published']);
|
|
106
110
|
*
|
|
107
111
|
* const { added, deleted } = ISet.diff(previous, current);
|
|
108
112
|
*
|
|
109
113
|
* assert.deepStrictEqual(Array.from(added), ['published']);
|
|
114
|
+
*
|
|
110
115
|
* assert.deepStrictEqual(Array.from(deleted), ['draft']);
|
|
111
116
|
* ```
|
|
112
117
|
*
|
|
@@ -134,6 +139,7 @@ var ISet;
|
|
|
134
139
|
*
|
|
135
140
|
* ```ts
|
|
136
141
|
* const left = ISet.create<number>([1, 2, 3]);
|
|
142
|
+
*
|
|
137
143
|
* const right = ISet.create<number>([2, 4]);
|
|
138
144
|
*
|
|
139
145
|
* const overlap = ISet.intersection(left, right);
|
|
@@ -161,6 +167,7 @@ var ISet;
|
|
|
161
167
|
*
|
|
162
168
|
* ```ts
|
|
163
169
|
* const numbers = ISet.create([1, 2]);
|
|
170
|
+
*
|
|
164
171
|
* const words = ISet.create(['one', 'two']);
|
|
165
172
|
*
|
|
166
173
|
* const union = ISet.union(numbers, words);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iset.mjs","sources":["../../src/collections/iset.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;
|
|
1
|
+
{"version":3,"file":"iset.mjs","sources":["../../src/collections/iset.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AA0hBA;AACM,IAAW;AAAjB,CAAA,UAAiB,IAAI,EAAA;AACnB;;;;;;;;;;;;;;;;;;;;;;AAsBG;IACU,IAAA,CAAA,MAAM,GAAG,CACpB,QAAqB,KACT,IAAI,SAAS,CAAI,QAAQ,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AACU,IAAA,IAAA,CAAA,KAAK,GAAG,CACnB,CAAU,EACV,CAAU,KACE,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;IACU,IAAA,CAAA,IAAI,GAAG,CAClB,MAAe,EACf,MAAe,MACmC;AAClD,QAAA,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;AAChC,QAAA,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;AAC/B,KAAA,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AACU,IAAA,IAAA,CAAA,YAAY,GAAG,CAC1B,CAAU,EACV,CAAU,KACE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAE5B;;;;;;;;;;;;;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