ts-data-forge 14.6.4 → 14.7.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 +2 -1
- package/dist/array/impl/array-utils-length-bounded-array-cast.d.mts +36 -6
- package/dist/array/impl/array-utils-length-bounded-array-cast.d.mts.map +1 -1
- package/dist/array/impl/array-utils-length-bounded-array-cast.mjs +4 -0
- package/dist/array/impl/array-utils-length-bounded-array-cast.mjs.map +1 -1
- package/dist/array/impl/array-utils-length-bounded-tuple-cast.d.mts +26 -6
- package/dist/array/impl/array-utils-length-bounded-tuple-cast.d.mts.map +1 -1
- package/dist/array/impl/array-utils-length-bounded-tuple-cast.mjs +4 -0
- package/dist/array/impl/array-utils-length-bounded-tuple-cast.mjs.map +1 -1
- package/dist/expect-type.d.mts +2 -70
- package/dist/expect-type.d.mts.map +1 -1
- package/dist/expect-type.mjs +1 -68
- package/dist/expect-type.mjs.map +1 -1
- package/dist/functional/index.d.mts +11 -6
- package/dist/functional/index.d.mts.map +1 -1
- package/dist/functional/index.mjs +10 -6
- package/dist/functional/index.mjs.map +1 -1
- package/dist/guard/has-key.d.mts +2 -51
- package/dist/guard/has-key.d.mts.map +1 -1
- package/dist/guard/has-key.mjs +1 -41
- package/dist/guard/has-key.mjs.map +1 -1
- package/dist/guard/is-non-null-object.d.mts +2 -34
- package/dist/guard/is-non-null-object.d.mts.map +1 -1
- package/dist/guard/is-non-null-object.mjs +1 -34
- package/dist/guard/is-non-null-object.mjs.map +1 -1
- package/dist/guard/is-record.d.mts +2 -89
- package/dist/guard/is-record.d.mts.map +1 -1
- package/dist/guard/is-record.mjs +1 -88
- package/dist/guard/is-record.mjs.map +1 -1
- package/dist/guard/key-is-in.d.mts +2 -42
- package/dist/guard/key-is-in.d.mts.map +1 -1
- package/dist/guard/key-is-in.mjs +1 -40
- package/dist/guard/key-is-in.mjs.map +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/dist/number/num.d.mts +9 -1
- package/dist/number/num.d.mts.map +1 -1
- package/dist/number/num.mjs +24 -16
- package/dist/number/num.mjs.map +1 -1
- package/dist/others/index.d.mts +1 -0
- package/dist/others/index.d.mts.map +1 -1
- package/dist/others/index.mjs +1 -0
- package/dist/others/index.mjs.map +1 -1
- package/dist/others/panic-error.d.mts +9 -0
- package/dist/others/panic-error.d.mts.map +1 -0
- package/dist/others/panic-error.mjs +9 -0
- package/dist/others/panic-error.mjs.map +1 -0
- package/dist/others/unknown-to-string.d.mts +2 -37
- package/dist/others/unknown-to-string.d.mts.map +1 -1
- package/dist/others/unknown-to-string.mjs +1 -92
- package/dist/others/unknown-to-string.mjs.map +1 -1
- package/dist/types.d.mts +1 -41
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +0 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +9 -9
- package/src/array/impl/array-utils-length-bounded-array-cast.mts +36 -6
- package/src/array/impl/array-utils-length-bounded-tuple-cast.mts +26 -6
- package/src/expect-type.mts +2 -78
- package/src/functional/index.mts +31 -6
- package/src/guard/has-key.mts +2 -72
- package/src/guard/is-non-null-object.mts +2 -36
- package/src/guard/is-record.mts +2 -95
- package/src/guard/key-is-in.mts +2 -49
- package/src/index.mts +2 -0
- package/src/number/num.mts +36 -28
- package/src/others/index.mts +1 -0
- package/src/others/panic-error.mts +8 -0
- package/src/others/unknown-to-string.mts +2 -111
- package/src/types.mts +4 -54
- package/dist/functional/async-result/async-result.d.mts +0 -16
- package/dist/functional/async-result/async-result.d.mts.map +0 -1
- package/dist/functional/async-result/async-result.mjs +0 -2
- package/dist/functional/async-result/async-result.mjs.map +0 -1
- package/dist/functional/async-result/impl/async-result-flat-map.d.mts +0 -39
- package/dist/functional/async-result/impl/async-result-flat-map.d.mts.map +0 -1
- package/dist/functional/async-result/impl/async-result-flat-map.mjs +0 -23
- package/dist/functional/async-result/impl/async-result-flat-map.mjs.map +0 -1
- package/dist/functional/async-result/impl/async-result-from-promise.d.mts +0 -47
- package/dist/functional/async-result/impl/async-result-from-promise.d.mts.map +0 -1
- package/dist/functional/async-result/impl/async-result-from-promise.mjs +0 -10
- package/dist/functional/async-result/impl/async-result-from-promise.mjs.map +0 -1
- package/dist/functional/async-result/impl/async-result-from-throwable.d.mts +0 -53
- package/dist/functional/async-result/impl/async-result-from-throwable.d.mts.map +0 -1
- package/dist/functional/async-result/impl/async-result-from-throwable.mjs +0 -15
- package/dist/functional/async-result/impl/async-result-from-throwable.mjs.map +0 -1
- package/dist/functional/async-result/impl/async-result-map-err.d.mts +0 -35
- package/dist/functional/async-result/impl/async-result-map-err.d.mts.map +0 -1
- package/dist/functional/async-result/impl/async-result-map-err.mjs +0 -20
- package/dist/functional/async-result/impl/async-result-map-err.mjs.map +0 -1
- package/dist/functional/async-result/impl/async-result-map.d.mts +0 -45
- package/dist/functional/async-result/impl/async-result-map.d.mts.map +0 -1
- package/dist/functional/async-result/impl/async-result-map.mjs +0 -20
- package/dist/functional/async-result/impl/async-result-map.mjs.map +0 -1
- package/dist/functional/async-result/impl/async-result-unwrap-or.d.mts +0 -34
- package/dist/functional/async-result/impl/async-result-unwrap-or.d.mts.map +0 -1
- package/dist/functional/async-result/impl/async-result-unwrap-or.mjs +0 -37
- package/dist/functional/async-result/impl/async-result-unwrap-or.mjs.map +0 -1
- package/dist/functional/async-result/impl/index.d.mts +0 -8
- package/dist/functional/async-result/impl/index.d.mts.map +0 -1
- package/dist/functional/async-result/impl/index.mjs +0 -8
- package/dist/functional/async-result/impl/index.mjs.map +0 -1
- package/dist/functional/async-result/impl/types.d.mts +0 -45
- package/dist/functional/async-result/impl/types.d.mts.map +0 -1
- package/dist/functional/async-result/impl/types.mjs +0 -2
- package/dist/functional/async-result/impl/types.mjs.map +0 -1
- package/dist/functional/async-result/index.d.mts +0 -2
- package/dist/functional/async-result/index.d.mts.map +0 -1
- package/dist/functional/async-result/index.mjs +0 -2
- package/dist/functional/async-result/index.mjs.map +0 -1
- package/dist/functional/match.d.mts +0 -80
- package/dist/functional/match.d.mts.map +0 -1
- package/dist/functional/match.mjs +0 -31
- package/dist/functional/match.mjs.map +0 -1
- package/dist/functional/optional/impl/index.d.mts +0 -19
- package/dist/functional/optional/impl/index.d.mts.map +0 -1
- package/dist/functional/optional/impl/index.mjs +0 -19
- package/dist/functional/optional/impl/index.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-expect-to-be.d.mts +0 -37
- package/dist/functional/optional/impl/optional-expect-to-be.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-expect-to-be.mjs +0 -22
- package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-filter.d.mts +0 -33
- package/dist/functional/optional/impl/optional-filter.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-filter.mjs +0 -25
- package/dist/functional/optional/impl/optional-filter.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-flat-map.d.mts +0 -39
- package/dist/functional/optional/impl/optional-flat-map.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-flat-map.mjs +0 -18
- package/dist/functional/optional/impl/optional-flat-map.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-from-nullable.d.mts +0 -27
- package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-from-nullable.mjs +0 -28
- package/dist/functional/optional/impl/optional-from-nullable.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-is-none.d.mts +0 -23
- package/dist/functional/optional/impl/optional-is-none.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-is-none.mjs +0 -22
- package/dist/functional/optional/impl/optional-is-none.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-is-optional.d.mts +0 -21
- package/dist/functional/optional/impl/optional-is-optional.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-is-optional.mjs +0 -26
- package/dist/functional/optional/impl/optional-is-optional.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-is-some.d.mts +0 -24
- package/dist/functional/optional/impl/optional-is-some.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-is-some.mjs +0 -23
- package/dist/functional/optional/impl/optional-is-some.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-map.d.mts +0 -34
- package/dist/functional/optional/impl/optional-map.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-map.mjs +0 -22
- package/dist/functional/optional/impl/optional-map.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-match.d.mts +0 -48
- package/dist/functional/optional/impl/optional-match.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-match.mjs +0 -20
- package/dist/functional/optional/impl/optional-match.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-none.d.mts +0 -19
- package/dist/functional/optional/impl/optional-none.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-none.mjs +0 -19
- package/dist/functional/optional/impl/optional-none.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-or-else.d.mts +0 -43
- package/dist/functional/optional/impl/optional-or-else.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-or-else.mjs +0 -16
- package/dist/functional/optional/impl/optional-or-else.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-some.d.mts +0 -22
- package/dist/functional/optional/impl/optional-some.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-some.mjs +0 -25
- package/dist/functional/optional/impl/optional-some.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-to-nullable.d.mts +0 -30
- package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-to-nullable.mjs +0 -30
- package/dist/functional/optional/impl/optional-to-nullable.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-unwrap-or.d.mts +0 -37
- package/dist/functional/optional/impl/optional-unwrap-or.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-unwrap-or.mjs +0 -16
- package/dist/functional/optional/impl/optional-unwrap-or.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-unwrap-throw.d.mts +0 -31
- package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-unwrap-throw.mjs +0 -36
- package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-unwrap.d.mts +0 -32
- package/dist/functional/optional/impl/optional-unwrap.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-unwrap.mjs +0 -8
- package/dist/functional/optional/impl/optional-unwrap.mjs.map +0 -1
- package/dist/functional/optional/impl/optional-zip.d.mts +0 -35
- package/dist/functional/optional/impl/optional-zip.d.mts.map +0 -1
- package/dist/functional/optional/impl/optional-zip.mjs +0 -39
- package/dist/functional/optional/impl/optional-zip.mjs.map +0 -1
- package/dist/functional/optional/impl/tag.d.mts +0 -6
- package/dist/functional/optional/impl/tag.d.mts.map +0 -1
- package/dist/functional/optional/impl/tag.mjs +0 -4
- package/dist/functional/optional/impl/tag.mjs.map +0 -1
- package/dist/functional/optional/impl/types.d.mts +0 -24
- package/dist/functional/optional/impl/types.d.mts.map +0 -1
- package/dist/functional/optional/impl/types.mjs +0 -2
- package/dist/functional/optional/impl/types.mjs.map +0 -1
- package/dist/functional/optional/index.d.mts +0 -2
- package/dist/functional/optional/index.d.mts.map +0 -1
- package/dist/functional/optional/index.mjs +0 -2
- package/dist/functional/optional/index.mjs.map +0 -1
- package/dist/functional/optional/optional.d.mts +0 -16
- package/dist/functional/optional/optional.d.mts.map +0 -1
- package/dist/functional/optional/optional.mjs +0 -2
- package/dist/functional/optional/optional.mjs.map +0 -1
- package/dist/functional/pipe.d.mts +0 -102
- package/dist/functional/pipe.d.mts.map +0 -1
- package/dist/functional/pipe.mjs +0 -45
- package/dist/functional/pipe.mjs.map +0 -1
- package/dist/functional/result/impl/index.d.mts +0 -28
- package/dist/functional/result/impl/index.d.mts.map +0 -1
- package/dist/functional/result/impl/index.mjs +0 -28
- package/dist/functional/result/impl/index.mjs.map +0 -1
- package/dist/functional/result/impl/result-err.d.mts +0 -28
- package/dist/functional/result/impl/result-err.d.mts.map +0 -1
- package/dist/functional/result/impl/result-err.mjs +0 -31
- package/dist/functional/result/impl/result-err.mjs.map +0 -1
- package/dist/functional/result/impl/result-expect-to-be.d.mts +0 -33
- package/dist/functional/result/impl/result-expect-to-be.d.mts.map +0 -1
- package/dist/functional/result/impl/result-expect-to-be.mjs +0 -23
- package/dist/functional/result/impl/result-expect-to-be.mjs.map +0 -1
- package/dist/functional/result/impl/result-flat-map.d.mts +0 -45
- package/dist/functional/result/impl/result-flat-map.d.mts.map +0 -1
- package/dist/functional/result/impl/result-flat-map.mjs +0 -21
- package/dist/functional/result/impl/result-flat-map.mjs.map +0 -1
- package/dist/functional/result/impl/result-fold.d.mts +0 -50
- package/dist/functional/result/impl/result-fold.d.mts.map +0 -1
- package/dist/functional/result/impl/result-fold.mjs +0 -23
- package/dist/functional/result/impl/result-fold.mjs.map +0 -1
- package/dist/functional/result/impl/result-from-optional.d.mts +0 -41
- package/dist/functional/result/impl/result-from-optional.d.mts.map +0 -1
- package/dist/functional/result/impl/result-from-optional.mjs +0 -21
- package/dist/functional/result/impl/result-from-optional.mjs.map +0 -1
- package/dist/functional/result/impl/result-from-promise.d.mts +0 -43
- package/dist/functional/result/impl/result-from-promise.d.mts.map +0 -1
- package/dist/functional/result/impl/result-from-promise.mjs +0 -39
- package/dist/functional/result/impl/result-from-promise.mjs.map +0 -1
- package/dist/functional/result/impl/result-from-throwable.d.mts +0 -32
- package/dist/functional/result/impl/result-from-throwable.d.mts.map +0 -1
- package/dist/functional/result/impl/result-from-throwable.mjs +0 -46
- package/dist/functional/result/impl/result-from-throwable.mjs.map +0 -1
- package/dist/functional/result/impl/result-is-err.d.mts +0 -23
- package/dist/functional/result/impl/result-is-err.d.mts.map +0 -1
- package/dist/functional/result/impl/result-is-err.mjs +0 -22
- package/dist/functional/result/impl/result-is-err.mjs.map +0 -1
- package/dist/functional/result/impl/result-is-ok.d.mts +0 -23
- package/dist/functional/result/impl/result-is-ok.d.mts.map +0 -1
- package/dist/functional/result/impl/result-is-ok.mjs +0 -22
- package/dist/functional/result/impl/result-is-ok.mjs.map +0 -1
- package/dist/functional/result/impl/result-is-result.d.mts +0 -22
- package/dist/functional/result/impl/result-is-result.d.mts.map +0 -1
- package/dist/functional/result/impl/result-is-result.mjs +0 -26
- package/dist/functional/result/impl/result-is-result.mjs.map +0 -1
- package/dist/functional/result/impl/result-map-err.d.mts +0 -39
- package/dist/functional/result/impl/result-map-err.d.mts.map +0 -1
- package/dist/functional/result/impl/result-map-err.mjs +0 -22
- package/dist/functional/result/impl/result-map-err.mjs.map +0 -1
- package/dist/functional/result/impl/result-map.d.mts +0 -39
- package/dist/functional/result/impl/result-map.d.mts.map +0 -1
- package/dist/functional/result/impl/result-map.mjs +0 -22
- package/dist/functional/result/impl/result-map.mjs.map +0 -1
- package/dist/functional/result/impl/result-match.d.mts +0 -47
- package/dist/functional/result/impl/result-match.d.mts.map +0 -1
- package/dist/functional/result/impl/result-match.mjs +0 -20
- package/dist/functional/result/impl/result-match.mjs.map +0 -1
- package/dist/functional/result/impl/result-ok.d.mts +0 -28
- package/dist/functional/result/impl/result-ok.d.mts.map +0 -1
- package/dist/functional/result/impl/result-ok.mjs +0 -31
- package/dist/functional/result/impl/result-ok.mjs.map +0 -1
- package/dist/functional/result/impl/result-or-else.d.mts +0 -40
- package/dist/functional/result/impl/result-or-else.d.mts.map +0 -1
- package/dist/functional/result/impl/result-or-else.mjs +0 -17
- package/dist/functional/result/impl/result-or-else.mjs.map +0 -1
- package/dist/functional/result/impl/result-safe-try.d.mts +0 -51
- package/dist/functional/result/impl/result-safe-try.d.mts.map +0 -1
- package/dist/functional/result/impl/result-safe-try.mjs +0 -35
- package/dist/functional/result/impl/result-safe-try.mjs.map +0 -1
- package/dist/functional/result/impl/result-safe-unwrap.d.mts +0 -36
- package/dist/functional/result/impl/result-safe-unwrap.d.mts.map +0 -1
- package/dist/functional/result/impl/result-safe-unwrap.mjs +0 -42
- package/dist/functional/result/impl/result-safe-unwrap.mjs.map +0 -1
- package/dist/functional/result/impl/result-swap.d.mts +0 -23
- package/dist/functional/result/impl/result-swap.d.mts.map +0 -1
- package/dist/functional/result/impl/result-swap.mjs +0 -27
- package/dist/functional/result/impl/result-swap.mjs.map +0 -1
- package/dist/functional/result/impl/result-to-optional.d.mts +0 -32
- package/dist/functional/result/impl/result-to-optional.d.mts.map +0 -1
- package/dist/functional/result/impl/result-to-optional.mjs +0 -32
- package/dist/functional/result/impl/result-to-optional.mjs.map +0 -1
- package/dist/functional/result/impl/result-unwrap-err-or.d.mts +0 -33
- package/dist/functional/result/impl/result-unwrap-err-or.d.mts.map +0 -1
- package/dist/functional/result/impl/result-unwrap-err-or.mjs +0 -17
- package/dist/functional/result/impl/result-unwrap-err-or.mjs.map +0 -1
- package/dist/functional/result/impl/result-unwrap-err-throw.d.mts +0 -33
- package/dist/functional/result/impl/result-unwrap-err-throw.d.mts.map +0 -1
- package/dist/functional/result/impl/result-unwrap-err-throw.mjs +0 -46
- package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +0 -1
- package/dist/functional/result/impl/result-unwrap-err.d.mts +0 -33
- package/dist/functional/result/impl/result-unwrap-err.d.mts.map +0 -1
- package/dist/functional/result/impl/result-unwrap-err.mjs +0 -34
- package/dist/functional/result/impl/result-unwrap-err.mjs.map +0 -1
- package/dist/functional/result/impl/result-unwrap-ok-or.d.mts +0 -33
- package/dist/functional/result/impl/result-unwrap-ok-or.d.mts.map +0 -1
- package/dist/functional/result/impl/result-unwrap-ok-or.mjs +0 -17
- package/dist/functional/result/impl/result-unwrap-ok-or.mjs.map +0 -1
- package/dist/functional/result/impl/result-unwrap-ok.d.mts +0 -26
- package/dist/functional/result/impl/result-unwrap-ok.d.mts.map +0 -1
- package/dist/functional/result/impl/result-unwrap-ok.mjs +0 -8
- package/dist/functional/result/impl/result-unwrap-ok.mjs.map +0 -1
- package/dist/functional/result/impl/result-unwrap-throw.d.mts +0 -33
- package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +0 -1
- package/dist/functional/result/impl/result-unwrap-throw.mjs +0 -40
- package/dist/functional/result/impl/result-unwrap-throw.mjs.map +0 -1
- package/dist/functional/result/impl/result-zip.d.mts +0 -32
- package/dist/functional/result/impl/result-zip.d.mts.map +0 -1
- package/dist/functional/result/impl/result-zip.mjs +0 -37
- package/dist/functional/result/impl/result-zip.mjs.map +0 -1
- package/dist/functional/result/impl/tag.d.mts +0 -6
- package/dist/functional/result/impl/tag.d.mts.map +0 -1
- package/dist/functional/result/impl/tag.mjs +0 -4
- package/dist/functional/result/impl/tag.mjs.map +0 -1
- package/dist/functional/result/impl/types.d.mts +0 -31
- package/dist/functional/result/impl/types.d.mts.map +0 -1
- package/dist/functional/result/impl/types.mjs +0 -2
- package/dist/functional/result/impl/types.mjs.map +0 -1
- package/dist/functional/result/index.d.mts +0 -2
- package/dist/functional/result/index.d.mts.map +0 -1
- package/dist/functional/result/index.mjs +0 -2
- package/dist/functional/result/index.mjs.map +0 -1
- package/dist/functional/result/result.d.mts +0 -16
- package/dist/functional/result/result.d.mts.map +0 -1
- package/dist/functional/result/result.mjs +0 -2
- package/dist/functional/result/result.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/index.d.mts +0 -29
- package/dist/functional/ternary-result/impl/index.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/index.mjs +0 -29
- package/dist/functional/ternary-result/impl/index.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/tag.d.mts +0 -8
- package/dist/functional/ternary-result/impl/tag.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/tag.mjs +0 -6
- package/dist/functional/ternary-result/impl/tag.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-err.d.mts +0 -16
- package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-err.mjs +0 -19
- package/dist/functional/ternary-result/impl/ternary-result-err.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts +0 -24
- package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs +0 -21
- package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts +0 -39
- package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs +0 -38
- package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts +0 -30
- package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-fold.mjs +0 -33
- package/dist/functional/ternary-result/impl/ternary-result-fold.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts +0 -23
- package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs +0 -23
- package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts +0 -20
- package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs +0 -33
- package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-err.d.mts +0 -21
- package/dist/functional/ternary-result/impl/ternary-result-is-err.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs +0 -20
- package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts +0 -23
- package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs +0 -22
- package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts +0 -22
- package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +0 -28
- package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts +0 -22
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs +0 -21
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts +0 -27
- package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs +0 -23
- package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts +0 -28
- package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs +0 -26
- package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-map.d.mts +0 -36
- package/dist/functional/ternary-result/impl/ternary-result-map.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-map.mjs +0 -32
- package/dist/functional/ternary-result/impl/ternary-result-map.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts +0 -17
- package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-ok.mjs +0 -20
- package/dist/functional/ternary-result/impl/ternary-result-ok.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts +0 -29
- package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs +0 -16
- package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts +0 -23
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs +0 -26
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts +0 -28
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs +0 -14
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts +0 -20
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs +0 -34
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts +0 -20
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs +0 -21
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts +0 -25
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs +0 -14
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts +0 -20
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs +0 -10
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts +0 -21
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs +0 -35
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts +0 -22
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs +0 -14
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts +0 -20
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs +0 -30
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts +0 -20
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs +0 -21
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts +0 -19
- package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-warn.mjs +0 -23
- package/dist/functional/ternary-result/impl/ternary-result-warn.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts +0 -34
- package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/ternary-result-zip.mjs +0 -52
- package/dist/functional/ternary-result/impl/ternary-result-zip.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/types.d.mts +0 -26
- package/dist/functional/ternary-result/impl/types.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/types.mjs +0 -2
- package/dist/functional/ternary-result/impl/types.mjs.map +0 -1
- package/dist/functional/ternary-result/impl/variant-name.d.mts +0 -4
- package/dist/functional/ternary-result/impl/variant-name.d.mts.map +0 -1
- package/dist/functional/ternary-result/impl/variant-name.mjs +0 -13
- package/dist/functional/ternary-result/impl/variant-name.mjs.map +0 -1
- package/dist/functional/ternary-result/index.d.mts +0 -2
- package/dist/functional/ternary-result/index.d.mts.map +0 -1
- package/dist/functional/ternary-result/index.mjs +0 -2
- package/dist/functional/ternary-result/index.mjs.map +0 -1
- package/dist/functional/ternary-result/ternary-result.d.mts +0 -40
- package/dist/functional/ternary-result/ternary-result.d.mts.map +0 -1
- package/dist/functional/ternary-result/ternary-result.mjs +0 -2
- package/dist/functional/ternary-result/ternary-result.mjs.map +0 -1
- package/src/functional/async-result/async-result.mts +0 -17
- package/src/functional/async-result/impl/async-result-flat-map.mts +0 -99
- package/src/functional/async-result/impl/async-result-from-promise.mts +0 -69
- package/src/functional/async-result/impl/async-result-from-throwable.mts +0 -78
- package/src/functional/async-result/impl/async-result-map-err.mts +0 -84
- package/src/functional/async-result/impl/async-result-map.mts +0 -94
- package/src/functional/async-result/impl/async-result-unwrap-or.mts +0 -42
- package/src/functional/async-result/impl/index.mts +0 -7
- package/src/functional/async-result/impl/types.mts +0 -51
- package/src/functional/async-result/index.mts +0 -1
- package/src/functional/async-result.test.mts +0 -291
- package/src/functional/match.mts +0 -193
- package/src/functional/match.test.mts +0 -180
- package/src/functional/optional/impl/index.mts +0 -18
- package/src/functional/optional/impl/optional-expect-to-be.mts +0 -75
- package/src/functional/optional/impl/optional-filter.mts +0 -78
- package/src/functional/optional/impl/optional-flat-map.mts +0 -75
- package/src/functional/optional/impl/optional-from-nullable.mts +0 -31
- package/src/functional/optional/impl/optional-is-none.mts +0 -26
- package/src/functional/optional/impl/optional-is-optional.mts +0 -30
- package/src/functional/optional/impl/optional-is-some.mts +0 -27
- package/src/functional/optional/impl/optional-map.mts +0 -90
- package/src/functional/optional/impl/optional-match.mts +0 -108
- package/src/functional/optional/impl/optional-none.mts +0 -20
- package/src/functional/optional/impl/optional-or-else.mts +0 -83
- package/src/functional/optional/impl/optional-some.mts +0 -27
- package/src/functional/optional/impl/optional-to-nullable.mts +0 -34
- package/src/functional/optional/impl/optional-unwrap-or.mts +0 -70
- package/src/functional/optional/impl/optional-unwrap-throw.mts +0 -41
- package/src/functional/optional/impl/optional-unwrap.mts +0 -45
- package/src/functional/optional/impl/optional-zip.mts +0 -44
- package/src/functional/optional/impl/tag.mts +0 -8
- package/src/functional/optional/impl/types.mts +0 -31
- package/src/functional/optional/index.mts +0 -1
- package/src/functional/optional/optional.mts +0 -19
- package/src/functional/optional.test.mts +0 -883
- package/src/functional/pipe.mts +0 -180
- package/src/functional/pipe.test.mts +0 -155
- package/src/functional/result/impl/index.mts +0 -27
- package/src/functional/result/impl/result-err.mts +0 -33
- package/src/functional/result/impl/result-expect-to-be.mts +0 -73
- package/src/functional/result/impl/result-flat-map.mts +0 -88
- package/src/functional/result/impl/result-fold.mts +0 -102
- package/src/functional/result/impl/result-from-optional.mts +0 -80
- package/src/functional/result/impl/result-from-promise.mts +0 -51
- package/src/functional/result/impl/result-from-throwable.mts +0 -48
- package/src/functional/result/impl/result-is-err.mts +0 -26
- package/src/functional/result/impl/result-is-ok.mts +0 -26
- package/src/functional/result/impl/result-is-result.mts +0 -28
- package/src/functional/result/impl/result-map-err.mts +0 -96
- package/src/functional/result/impl/result-map.mts +0 -96
- package/src/functional/result/impl/result-match.mts +0 -108
- package/src/functional/result/impl/result-ok.mts +0 -33
- package/src/functional/result/impl/result-or-else.mts +0 -73
- package/src/functional/result/impl/result-safe-try.mts +0 -110
- package/src/functional/result/impl/result-safe-unwrap.mts +0 -50
- package/src/functional/result/impl/result-swap.mts +0 -31
- package/src/functional/result/impl/result-to-optional.mts +0 -37
- package/src/functional/result/impl/result-unwrap-err-or.mts +0 -66
- package/src/functional/result/impl/result-unwrap-err-throw.mts +0 -56
- package/src/functional/result/impl/result-unwrap-err.mts +0 -38
- package/src/functional/result/impl/result-unwrap-ok-or.mts +0 -66
- package/src/functional/result/impl/result-unwrap-ok.mts +0 -39
- package/src/functional/result/impl/result-unwrap-throw.mts +0 -46
- package/src/functional/result/impl/result-zip.mts +0 -42
- package/src/functional/result/impl/tag.mts +0 -8
- package/src/functional/result/impl/types.mts +0 -38
- package/src/functional/result/index.mts +0 -1
- package/src/functional/result/result.mts +0 -19
- package/src/functional/result.test.mts +0 -1349
- package/src/functional/ternary-result/impl/index.mts +0 -28
- package/src/functional/ternary-result/impl/tag.mts +0 -17
- package/src/functional/ternary-result/impl/ternary-result-err.mts +0 -21
- package/src/functional/ternary-result/impl/ternary-result-expect-to-be.mts +0 -65
- package/src/functional/ternary-result/impl/ternary-result-flat-map.mts +0 -112
- package/src/functional/ternary-result/impl/ternary-result-fold.mts +0 -102
- package/src/functional/ternary-result/impl/ternary-result-from-promise.mts +0 -30
- package/src/functional/ternary-result/impl/ternary-result-from-throwable.mts +0 -36
- package/src/functional/ternary-result/impl/ternary-result-is-err.mts +0 -24
- package/src/functional/ternary-result/impl/ternary-result-is-ok.mts +0 -26
- package/src/functional/ternary-result/impl/ternary-result-is-ternary-result.mts +0 -32
- package/src/functional/ternary-result/impl/ternary-result-is-warn.mts +0 -25
- package/src/functional/ternary-result/impl/ternary-result-map-err.mts +0 -74
- package/src/functional/ternary-result/impl/ternary-result-map-warn.mts +0 -79
- package/src/functional/ternary-result/impl/ternary-result-map.mts +0 -95
- package/src/functional/ternary-result/impl/ternary-result-ok.mts +0 -22
- package/src/functional/ternary-result/impl/ternary-result-or-else.mts +0 -72
- package/src/functional/ternary-result/impl/ternary-result-to-optional.mts +0 -31
- package/src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts +0 -54
- package/src/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mts +0 -42
- package/src/functional/ternary-result/impl/ternary-result-unwrap-err.mts +0 -25
- package/src/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mts +0 -51
- package/src/functional/ternary-result/impl/ternary-result-unwrap-ok.mts +0 -39
- package/src/functional/ternary-result/impl/ternary-result-unwrap-throw.mts +0 -48
- package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mts +0 -48
- package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mts +0 -40
- package/src/functional/ternary-result/impl/ternary-result-unwrap-warn.mts +0 -25
- package/src/functional/ternary-result/impl/ternary-result-warn.mts +0 -28
- package/src/functional/ternary-result/impl/ternary-result-zip.mts +0 -61
- package/src/functional/ternary-result/impl/types.mts +0 -46
- package/src/functional/ternary-result/impl/variant-name.mts +0 -18
- package/src/functional/ternary-result/index.mts +0 -1
- package/src/functional/ternary-result/ternary-result.mts +0 -50
- package/src/functional/ternary-result.test.mts +0 -310
- package/src/guard/has-key.test.mts +0 -111
- package/src/guard/is-non-null-object.test.mts +0 -109
- package/src/guard/is-record.test.mts +0 -195
- package/src/guard/key-is-in.test.mts +0 -21
- package/src/others/unknown-to-string.test.mts +0 -295
package/README.md
CHANGED
|
@@ -126,6 +126,7 @@ Additional helpers for common programming tasks.
|
|
|
126
126
|
|
|
127
127
|
- **Type Casting** - `castMutable`, `castReadonly`
|
|
128
128
|
- **Utilities** - `memoizeFunction`, `mapNullable`, `unknownToString`
|
|
129
|
+
- **Panics** - `PanicError`, `isPanicError`, `createPanicError`: the error a programming-error stop throws (the `panic` / `unreachable` / `todo` functions live in ts-std-forge). A panic is marked by a `$$panic` property rather than by the error `name`, so an error keeps its own identity while being recognized as a panic; the `Result` / `AsyncResult` boundary functions rethrow one instead of turning it into `Err`.
|
|
129
130
|
- **Conditionals** - `ifThen` for conditional operations
|
|
130
131
|
|
|
131
132
|
## Usage Examples
|
|
@@ -627,7 +628,7 @@ assert.deepStrictEqual(updatedState.items, ['newItem1', 'newItem2']);
|
|
|
627
628
|
- **`json`**: Type-safe JSON parsing and stringification utilities.
|
|
628
629
|
- **`collections`**: Immutable data structures like `IMap`, `ISet`, and `Queue` with full type safety.
|
|
629
630
|
- **`iterator`**: Utilities for working with iterators and generators (e.g., `range`).
|
|
630
|
-
- **`others`**: Miscellaneous utilities like `castMutable`, `castReadonly`, `ifThen`, `mapNullable`, `memoizeFunction`, `tuple`, `unknownToString`.
|
|
631
|
+
- **`others`**: Miscellaneous utilities like `castMutable`, `castReadonly`, `ifThen`, `mapNullable`, `memoizeFunction`, `PanicError` / `isPanicError` / `createPanicError`, `tuple`, `unknownToString`.
|
|
631
632
|
|
|
632
633
|
## Key Benefits
|
|
633
634
|
|
|
@@ -19,13 +19,21 @@ import { type BoundedLengthArray, type FixedLengthArray, type MaxLengthArray, ty
|
|
|
19
19
|
* const rgb = Arr.asFixedLengthArray(3, [255, 128, 0]);
|
|
20
20
|
*
|
|
21
21
|
* const atMost5: MaxLengthArray<5, number> = rgb; // OK (3 <= 5)
|
|
22
|
+
*
|
|
22
23
|
* const red: number = rgb[0]; // OK — no `undefined`
|
|
23
24
|
*
|
|
24
25
|
* // curried version
|
|
25
26
|
* const asRgb = Arr.asFixedLengthArray(3);
|
|
27
|
+
*
|
|
26
28
|
* const green = asRgb([0, 255, 0]);
|
|
27
29
|
*
|
|
28
|
-
*
|
|
30
|
+
* assert.deepStrictEqual(Array.from(atMost5), [255, 128, 0]);
|
|
31
|
+
*
|
|
32
|
+
* assert.strictEqual(red, 255);
|
|
33
|
+
*
|
|
34
|
+
* assert.deepStrictEqual(green, [0, 255, 0]);
|
|
35
|
+
*
|
|
36
|
+
* assert.throws(() => Arr.asFixedLengthArray(3, [255, 128]), TypeError);
|
|
29
37
|
* ```
|
|
30
38
|
*
|
|
31
39
|
* @template Length - The exact number of elements.
|
|
@@ -57,13 +65,21 @@ export declare function asFixedLengthArray<Length extends SupportedLength>(lengt
|
|
|
57
65
|
* const history = Arr.asMinLengthArray(3, [0, 1, 2, 3]);
|
|
58
66
|
*
|
|
59
67
|
* const nonEmpty: MinLengthArray<1, number> = history; // OK (3 >= 1)
|
|
68
|
+
*
|
|
60
69
|
* const first: number = history[0]; // OK — no `undefined`
|
|
61
70
|
*
|
|
62
71
|
* // curried version
|
|
63
72
|
* const asHistory = Arr.asMinLengthArray(3);
|
|
73
|
+
*
|
|
64
74
|
* const next = asHistory([4, 5, 6, 7]);
|
|
65
75
|
*
|
|
66
|
-
*
|
|
76
|
+
* assert.deepStrictEqual(Array.from(nonEmpty), [0, 1, 2, 3]);
|
|
77
|
+
*
|
|
78
|
+
* assert.strictEqual(first, 0);
|
|
79
|
+
*
|
|
80
|
+
* assert.deepStrictEqual(next, [4, 5, 6, 7]);
|
|
81
|
+
*
|
|
82
|
+
* assert.throws(() => Arr.asMinLengthArray(3, [0]), TypeError);
|
|
67
83
|
* ```
|
|
68
84
|
*
|
|
69
85
|
* @template MinLength - The minimum number of elements (inclusive).
|
|
@@ -96,9 +112,14 @@ export declare function asMinLengthArray<MinLength extends SupportedLength>(minL
|
|
|
96
112
|
*
|
|
97
113
|
* // curried version
|
|
98
114
|
* const asTags = Arr.asMaxLengthArray(8);
|
|
115
|
+
*
|
|
99
116
|
* const more = asTags(['d', 'e']);
|
|
100
117
|
*
|
|
101
|
-
*
|
|
118
|
+
* assert.deepStrictEqual(Array.from(relaxed), ['a', 'b', 'c']);
|
|
119
|
+
*
|
|
120
|
+
* assert.deepStrictEqual(more, ['d', 'e']);
|
|
121
|
+
*
|
|
122
|
+
* assert.throws(() => Arr.asMaxLengthArray(2, ['a', 'b', 'c']), TypeError);
|
|
102
123
|
* ```
|
|
103
124
|
*
|
|
104
125
|
* @template MaxLength - The maximum number of elements (inclusive).
|
|
@@ -133,9 +154,14 @@ export declare function asMaxLengthArray<MaxLength extends SupportedLength>(maxL
|
|
|
133
154
|
*
|
|
134
155
|
* // curried version
|
|
135
156
|
* const asSelection = Arr.asBoundedLengthArray(1, 5);
|
|
157
|
+
*
|
|
136
158
|
* const next = asSelection([4, 5]);
|
|
137
159
|
*
|
|
138
|
-
*
|
|
160
|
+
* assert.deepStrictEqual(Array.from(relaxed), [1, 2, 3]);
|
|
161
|
+
*
|
|
162
|
+
* assert.deepStrictEqual(next, [4, 5]);
|
|
163
|
+
*
|
|
164
|
+
* assert.throws(() => Arr.asBoundedLengthArray(1, 5, []), TypeError);
|
|
139
165
|
* ```
|
|
140
166
|
*
|
|
141
167
|
* @template MinLength - The minimum number of elements (inclusive).
|
|
@@ -165,7 +191,9 @@ export declare function asBoundedLengthArray<MinLength extends SupportedLength,
|
|
|
165
191
|
*
|
|
166
192
|
* const atMost5: MaxLengthArray<5, never> = nothing; // OK (0 <= 5)
|
|
167
193
|
*
|
|
168
|
-
*
|
|
194
|
+
* assert.deepStrictEqual(Array.from(atMost5), []);
|
|
195
|
+
*
|
|
196
|
+
* assert.throws(() => Arr.asEmptyArray([1]), TypeError);
|
|
169
197
|
* ```
|
|
170
198
|
*
|
|
171
199
|
* @template Xs - The input array type (tuple types are preserved).
|
|
@@ -192,7 +220,9 @@ export declare const asEmptyArray: <Xs extends readonly unknown[]>(xs: Xs) => Fi
|
|
|
192
220
|
*
|
|
193
221
|
* const first: number = history[0]; // OK — no `undefined`
|
|
194
222
|
*
|
|
195
|
-
*
|
|
223
|
+
* assert.strictEqual(first, 0);
|
|
224
|
+
*
|
|
225
|
+
* assert.throws(() => Arr.asNonEmptyArray([]), TypeError);
|
|
196
226
|
* ```
|
|
197
227
|
*
|
|
198
228
|
* @template Xs - The input array type (tuple types are preserved).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-utils-length-bounded-array-cast.d.mts","sourceRoot":"","sources":["../../../src/array/impl/array-utils-length-bounded-array-cast.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAQvB
|
|
1
|
+
{"version":3,"file":"array-utils-length-bounded-array-cast.d.mts","sourceRoot":"","sources":["../../../src/array/impl/array-utils-length-bounded-array-cast.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAQvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,SAAS,eAAe,EAC9B,EAAE,SAAS,SAAS,OAAO,EAAE,EAC7B,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC;AAGrE,wBAAgB,kBAAkB,CAAC,MAAM,SAAS,eAAe,EAC/D,MAAM,EAAE,MAAM,GACb,CAAC,EAAE,SAAS,SAAS,OAAO,EAAE,EAC/B,EAAE,EAAE,EAAE,KACH,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC;AA+B/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,SAAS,eAAe,EACjC,EAAE,SAAS,SAAS,OAAO,EAAE,EAC7B,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,GAAG,cAAc,CAAC,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC;AAG5E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B,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC;AAoC/D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,YAAY,GAAI,EAAE,SAAS,SAAS,OAAO,EAAE,MACpD,EAAE,KACL,gBAAgB,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAQpC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,eAAe,GAAI,EAAE,SAAS,SAAS,OAAO,EAAE,MACvD,EAAE,KACL,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAM9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-utils-length-bounded-array-cast.mjs","sourceRoot":"","sources":["../../../src/array/impl/array-utils-length-bounded-array-cast.mts"],"names":[],"mappings":"AAQA,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"array-utils-length-bounded-array-cast.mjs","sourceRoot":"","sources":["../../../src/array/impl/array-utils-length-bounded-array-cast.mts"],"names":[],"mappings":"AAQA,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,8CAA8C,CAAC;AA0DtD,MAAM,UAAU,kBAAkB,CAChC,GAAG,IAEmC;IAEtC,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;QACpB,KAAK,CAAC;YACJ,OAAO,sBAAsB,CAAC,GAAG,IAAI,CAAC,CAAC;QAEzC,KAAK,CAAC;YACJ,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC;AAED,MAAM,sBAAsB,GAAG,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J,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,EAAM,EAC0B,EAAE;IAClC,IAAI,CAAC,gBAAgB,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,SAAS,CAAC,gDAAgD,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC"}
|
|
@@ -23,7 +23,11 @@ import { type SizeType } from '../../types.mjs';
|
|
|
23
23
|
* // curried version
|
|
24
24
|
* const asRgb = Arr.asFixedLengthTuple(3);
|
|
25
25
|
*
|
|
26
|
-
*
|
|
26
|
+
* assert.strictEqual(red, 255);
|
|
27
|
+
*
|
|
28
|
+
* assert.deepStrictEqual(asRgb([0, 255, 0]), [0, 255, 0]);
|
|
29
|
+
*
|
|
30
|
+
* assert.throws(() => Arr.asFixedLengthTuple(3, [255, 128]), TypeError);
|
|
27
31
|
* ```
|
|
28
32
|
*
|
|
29
33
|
* @template Length - The exact number of elements.
|
|
@@ -52,7 +56,11 @@ export declare function asFixedLengthTuple<Length extends SizeType.ArgArr>(lengt
|
|
|
52
56
|
* // curried version
|
|
53
57
|
* const asHistory = Arr.asMinLengthTuple(3);
|
|
54
58
|
*
|
|
55
|
-
*
|
|
59
|
+
* assert.strictEqual(first, 0);
|
|
60
|
+
*
|
|
61
|
+
* assert.deepStrictEqual(asHistory([4, 5, 6]), [4, 5, 6]);
|
|
62
|
+
*
|
|
63
|
+
* assert.throws(() => Arr.asMinLengthTuple(3, [0, 1]), TypeError);
|
|
56
64
|
* ```
|
|
57
65
|
*
|
|
58
66
|
* @template MinLength - The minimum number of elements (inclusive).
|
|
@@ -79,7 +87,11 @@ export declare function asMinLengthTuple<MinLength extends SizeType.ArgArr>(minL
|
|
|
79
87
|
* // curried version
|
|
80
88
|
* const asTags = Arr.asMaxLengthTuple(8);
|
|
81
89
|
*
|
|
82
|
-
*
|
|
90
|
+
* assert.deepStrictEqual(tags, ['a', 'b', 'c']);
|
|
91
|
+
*
|
|
92
|
+
* assert.deepStrictEqual(asTags(['d', 'e']), ['d', 'e']);
|
|
93
|
+
*
|
|
94
|
+
* assert.throws(() => Arr.asMaxLengthTuple(2, ['a', 'b', 'c']), TypeError);
|
|
83
95
|
* ```
|
|
84
96
|
*
|
|
85
97
|
* @template MaxLength - The maximum number of elements (inclusive).
|
|
@@ -106,7 +118,11 @@ export declare function asMaxLengthTuple<MaxLength extends SizeType.ArgArr>(maxL
|
|
|
106
118
|
* // curried version
|
|
107
119
|
* const asSelection = Arr.asBoundedLengthTuple(1, 5);
|
|
108
120
|
*
|
|
109
|
-
*
|
|
121
|
+
* assert.deepStrictEqual(selection, [1, 2, 3]);
|
|
122
|
+
*
|
|
123
|
+
* assert.deepStrictEqual(asSelection([4, 5]), [4, 5]);
|
|
124
|
+
*
|
|
125
|
+
* assert.throws(() => Arr.asBoundedLengthTuple(1, 2, [1, 2, 3]), TypeError);
|
|
110
126
|
* ```
|
|
111
127
|
*
|
|
112
128
|
* @template Min - The minimum number of elements (inclusive).
|
|
@@ -132,7 +148,9 @@ export declare function asBoundedLengthTuple<Min extends SizeType.ArgArr, Max ex
|
|
|
132
148
|
* ```ts
|
|
133
149
|
* const nothing = Arr.asEmptyTuple([]);
|
|
134
150
|
*
|
|
135
|
-
*
|
|
151
|
+
* assert.deepStrictEqual(nothing, []);
|
|
152
|
+
*
|
|
153
|
+
* assert.throws(() => Arr.asEmptyTuple([1]), TypeError);
|
|
136
154
|
* ```
|
|
137
155
|
*
|
|
138
156
|
* @template Xs - The input array type (tuple types are preserved).
|
|
@@ -155,7 +173,9 @@ export declare const asEmptyTuple: <Xs extends readonly unknown[]>(xs: Xs) => re
|
|
|
155
173
|
*
|
|
156
174
|
* const first: number = values[0]; // OK — no `undefined`
|
|
157
175
|
*
|
|
158
|
-
*
|
|
176
|
+
* assert.strictEqual(first, 1);
|
|
177
|
+
*
|
|
178
|
+
* assert.throws(() => Arr.asNonEmptyTuple([]), TypeError);
|
|
159
179
|
* ```
|
|
160
180
|
*
|
|
161
181
|
* @template Xs - The input array type (tuple types are preserved).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-utils-length-bounded-tuple-cast.d.mts","sourceRoot":"","sources":["../../../src/array/impl/array-utils-length-bounded-tuple-cast.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAShD
|
|
1
|
+
{"version":3,"file":"array-utils-length-bounded-tuple-cast.d.mts","sourceRoot":"","sources":["../../../src/array/impl/array-utils-length-bounded-tuple-cast.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAShD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,SAAS,QAAQ,CAAC,MAAM,EAC9B,EAAE,SAAS,SAAS,OAAO,EAAE,EAC7B,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC;AAGrE,wBAAgB,kBAAkB,CAAC,MAAM,SAAS,QAAQ,CAAC,MAAM,EAC/D,MAAM,EAAE,MAAM,GACb,CAAC,EAAE,SAAS,SAAS,OAAO,EAAE,EAC/B,EAAE,EAAE,EAAE,KACH,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAA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C7B,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,GAAG,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC;AAG7E,wBAAgB,oBAAoB,CAClC,GAAG,SAAS,QAAQ,CAAC,MAAM,EAC3B,GAAG,SAAS,QAAQ,CAAC,MAAM,EAE3B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,GACP,CAAC,EAAE,SAAS,SAAS,OAAO,EAAE,EAC/B,EAAE,EAAE,EAAE,KACH,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC;AAoCnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,YAAY,GAAI,EAAE,SAAS,SAAS,OAAO,EAAE,MACpD,EAAE,KACL,SAAS,EAAE,GAAG,EAQhB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,eAAe,GAAI,EAAE,SAAS,SAAS,OAAO,EAAE,MACvD,EAAE,KACL,cAAc,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAMlC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-utils-length-bounded-tuple-cast.mjs","sourceRoot":"","sources":["../../../src/array/impl/array-utils-length-bounded-tuple-cast.mts"],"names":[],"mappings":"AAOA,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"array-utils-length-bounded-tuple-cast.mjs","sourceRoot":"","sources":["../../../src/array/impl/array-utils-length-bounded-tuple-cast.mts"],"names":[],"mappings":"AAOA,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,g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AG,6BAA6B,YAAY,EAAE,CAC1F,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,EAAM,EACY,EAAE;IACpB,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,SAAS,CACjB,mDAAmD,EAAE,CAAC,MAAM,EAAE,CAC/D,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,EAAM,EAC8B,EAAE;IACtC,IAAI,CAAC,gBAAgB,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,SAAS,CAAC,gDAAgD,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC"}
|
package/dist/expect-type.d.mts
CHANGED
|
@@ -1,71 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Compile-time type assertion utility for TypeScript type testing.
|
|
4
|
-
*
|
|
5
|
-
* This function performs static type relationship checking at compile-time and
|
|
6
|
-
* has no runtime effect. It is primarily used in test files to verify that
|
|
7
|
-
* TypeScript's type inference and type relationships work as expected. The
|
|
8
|
-
* function will cause TypeScript compilation errors if the specified type
|
|
9
|
-
* relationship does not hold.
|
|
10
|
-
*
|
|
11
|
-
* ## Supported Type Relations
|
|
12
|
-
*
|
|
13
|
-
* ### Equality Relations
|
|
14
|
-
*
|
|
15
|
-
* - **`"="` (strict equality)**: Asserts that types `A` and `B` are exactly the
|
|
16
|
-
* same type. Uses TypeScript's internal type equality checking.
|
|
17
|
-
* - **`"!="` (strict inequality)**: Asserts that types `A` and `B` are not
|
|
18
|
-
* exactly the same type.
|
|
19
|
-
*
|
|
20
|
-
* ### Assignability Relations
|
|
21
|
-
*
|
|
22
|
-
* - **`"~="` (mutual assignability)**: Asserts that `A` extends `B` AND `B`
|
|
23
|
-
* extends `A`. Types are structurally equivalent and mutually assignable.
|
|
24
|
-
* - **`"<="` (subtype relation)**: Asserts that type `A` extends (is assignable
|
|
25
|
-
* to) type `B`. Type `A` is a subtype of `B`.
|
|
26
|
-
* - **`">="` (supertype relation)**: Asserts that type `B` extends (is assignable
|
|
27
|
-
* to) type `A`. Type `A` is a supertype of `B`.
|
|
28
|
-
*
|
|
29
|
-
* ### Negative Assignability Relations
|
|
30
|
-
*
|
|
31
|
-
* - **`"!<="` (not subtype)**: Asserts that type `A` does NOT extend type `B`.
|
|
32
|
-
* - **`"!>="` (not supertype)**: Asserts that type `B` does NOT extend type `A`.
|
|
33
|
-
*
|
|
34
|
-
* ## Type Parameter Constraints
|
|
35
|
-
*
|
|
36
|
-
* @since 1.0.0
|
|
37
|
-
* @template A - The first type for comparison. Can be any TypeScript type
|
|
38
|
-
* including:
|
|
39
|
-
*
|
|
40
|
-
* - Primitive types (string, number, boolean, etc.)
|
|
41
|
-
* - Object types and interfaces
|
|
42
|
-
* - Union and intersection types
|
|
43
|
-
* - Generic types and type parameters
|
|
44
|
-
* - Literal types and branded types
|
|
45
|
-
* - Function types and return types
|
|
46
|
-
*
|
|
47
|
-
* @template B - The second type for comparison. Same constraints as type `A`.
|
|
48
|
-
* @param _relation - A string literal representing the expected type
|
|
49
|
-
* relationship. TypeScript's type system automatically infers and restricts
|
|
50
|
-
* the available operators based on the actual relationship between types `A`
|
|
51
|
-
* and `B`. If an invalid relationship is specified, TypeScript will show a
|
|
52
|
-
* compilation error.
|
|
53
|
-
*
|
|
54
|
-
* Combine `expectType` with runtime assertions for comprehensive testing:
|
|
55
|
-
*
|
|
56
|
-
* ## Important Notes
|
|
57
|
-
*
|
|
58
|
-
* - **Compile-time only**: This function has no runtime behavior and will be
|
|
59
|
-
* optimized away.
|
|
60
|
-
* - **Type inference**: The available relation operators are automatically
|
|
61
|
-
* inferred by TypeScript based on the actual type relationship between
|
|
62
|
-
* `A` and `B`.
|
|
63
|
-
* - **Error feedback**: Invalid type relationships will cause clear TypeScript
|
|
64
|
-
* compilation errors.
|
|
65
|
-
* - **Test organization**: Typically used in `.test.mts` files alongside runtime
|
|
66
|
-
* assertions.
|
|
67
|
-
* - **Performance**: Has zero runtime overhead as it's purely a compile-time
|
|
68
|
-
* construct.
|
|
69
|
-
*/
|
|
70
|
-
export declare const expectType: <A, B>(_relation: TypeEq<A, B> extends true ? '<=' | '=' | '>=' | '~=' : '!=' | (TypeExtends<A, B> extends true ? '<=' | (TypeExtends<B, A> extends true ? '>=' | '~=' : '!>=') : '!<=' | (TypeExtends<B, A> extends true ? '>=' : '!>='))) => void;
|
|
1
|
+
/** Implemented in ts-std-forge since Sumi D-49; re-exported here. */
|
|
2
|
+
export { expectType } from 'ts-std-forge';
|
|
71
3
|
//# sourceMappingURL=expect-type.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expect-type.d.mts","sourceRoot":"","sources":["../src/expect-type.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"expect-type.d.mts","sourceRoot":"","sources":["../src/expect-type.mts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/expect-type.mjs
CHANGED
|
@@ -1,70 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
export const expectType = (_relation) => undefined;
|
|
2
|
+
export { expectType } from 'ts-std-forge';
|
|
70
3
|
//# sourceMappingURL=expect-type.mjs.map
|
package/dist/expect-type.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expect-type.mjs","sourceRoot":"","sources":["../src/expect-type.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expect-type.mjs","sourceRoot":"","sources":["../src/expect-type.mts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The algebraic data type core. The implementation lives in ts-std-forge
|
|
3
|
+
* since Sumi D-49 reversed the dependency between the two packages; what
|
|
4
|
+
* remains here is the re-export that keeps `import { Result } from
|
|
5
|
+
* 'ts-data-forge'` working. Both names denote the same declarations, so a
|
|
6
|
+
* value built through either package is the same type to both.
|
|
7
|
+
*
|
|
8
|
+
* New code should import these from `ts-std-forge` directly.
|
|
9
|
+
*/
|
|
10
|
+
export { AsyncResult, Optional, Result, TernaryResult, match, pipe, } from 'ts-std-forge';
|
|
11
|
+
export type { Err, None, Ok, Pipe, Some, TernaryErr, TernaryOk, TernaryWarn, UnknownOptional, UnknownResult, UnknownTernaryResult, } from 'ts-std-forge';
|
|
7
12
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/functional/index.mts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/functional/index.mts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,aAAa,EACb,KAAK,EACL,IAAI,GACL,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,GAAG,EACH,IAAI,EACJ,EAAE,EACF,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,SAAS,EACT,WAAW,EACX,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,cAAc,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export { AsyncResult, Optional, Result, TernaryResult, match, pipe, } from 'ts-std-forge';
|
|
7
11
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/functional/index.mts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/functional/index.mts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,aAAa,EACb,KAAK,EACL,IAAI,GACL,MAAM,cAAc,CAAC"}
|
package/dist/guard/has-key.d.mts
CHANGED
|
@@ -1,52 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Type guard function that checks if an object has a specific key as its own
|
|
4
|
-
* property.
|
|
5
|
-
*
|
|
6
|
-
* This function uses `Object.hasOwn()` to check if the given object has the
|
|
7
|
-
* specified key as its own property (not inherited). It acts as a type guard
|
|
8
|
-
* that narrows the type of the object to guarantee the key exists, enabling
|
|
9
|
-
* type-safe property access.
|
|
10
|
-
*
|
|
11
|
-
* **Type Narrowing Behavior:**
|
|
12
|
-
*
|
|
13
|
-
* - When the guard returns `true`, TypeScript narrows the object type to include
|
|
14
|
-
* the checked key
|
|
15
|
-
* - For union types, only union members that contain the key are preserved
|
|
16
|
-
* - The key's value type is preserved from the original object type when possible
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
*
|
|
20
|
-
* ```ts
|
|
21
|
-
* const maybeUser: Readonly<{ id?: number; name?: string }> = {
|
|
22
|
-
* id: 42,
|
|
23
|
-
* } as const;
|
|
24
|
-
*
|
|
25
|
-
* if (hasKey(maybeUser, 'id')) {
|
|
26
|
-
* // `maybeUser` is now known to have an `id` property.
|
|
27
|
-
* assert.isTrue(maybeUser.id === 42);
|
|
28
|
-
* } else {
|
|
29
|
-
* assert.fail();
|
|
30
|
-
* }
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* @template R - The type of the input object, must extend UnknownRecord
|
|
34
|
-
* @template K - The type of the key to check for, must extend PropertyKey
|
|
35
|
-
* (string | number | symbol)
|
|
36
|
-
* @param obj - The object to check for the presence of the key
|
|
37
|
-
* @param key - The key to check for in the object
|
|
38
|
-
* @returns `true` if the object has the specified key as its own property,
|
|
39
|
-
* `false` otherwise. When `true`, TypeScript narrows the object type to
|
|
40
|
-
* guarantee the key exists.
|
|
41
|
-
* @see {@link keyIsIn} - Similar function that narrows the key type instead of the object type
|
|
42
|
-
*/
|
|
43
|
-
export declare const hasKey: <const R extends UnknownRecord, const K extends PropertyKey>(obj: R, key: K) => obj is HasKeyReturnType<R, K>;
|
|
44
|
-
/**
|
|
45
|
-
* @internal
|
|
46
|
-
* When R is a union type (including the case with only one element), if any element in the union
|
|
47
|
-
* contains K as a key, returns a type that narrows the union to only those elements that contain K as a key.
|
|
48
|
-
* If none of the elements in the union contain K as a key, returns `ReadonlyRecord<K, unknown>`.
|
|
49
|
-
* The result is made readonly.
|
|
50
|
-
*/
|
|
51
|
-
export type HasKeyReturnType<R extends UnknownRecord, K extends PropertyKey> = R extends R ? K extends keyof R ? string extends keyof R ? ReadonlyRecord<K, R[keyof R]> & R : number extends keyof R ? ReadonlyRecord<K, R[keyof R]> & R : symbol extends keyof R ? ReadonlyRecord<K, R[keyof R]> & R : R : never : never;
|
|
1
|
+
/** Implemented in ts-std-forge since Sumi D-49; re-exported here. */
|
|
2
|
+
export { hasKey, type HasKeyReturnType } from 'ts-std-forge';
|
|
52
3
|
//# sourceMappingURL=has-key.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-key.d.mts","sourceRoot":"","sources":["../../src/guard/has-key.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"has-key.d.mts","sourceRoot":"","sources":["../../src/guard/has-key.mts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,EAAE,MAAM,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/guard/has-key.mjs
CHANGED
|
@@ -1,43 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export const hasKey = (obj, key) => Object.hasOwn(obj, key);
|
|
2
|
+
export { hasKey } from 'ts-std-forge';
|
|
43
3
|
//# sourceMappingURL=has-key.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-key.mjs","sourceRoot":"","sources":["../../src/guard/has-key.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"has-key.mjs","sourceRoot":"","sources":["../../src/guard/has-key.mts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,EAAE,MAAM,EAAyB,MAAM,cAAc,CAAC"}
|
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* This function checks if a value has type `"object"` according to the `typeof`
|
|
5
|
-
* operator and is not `null`. This includes all object types such as plain
|
|
6
|
-
* objects, arrays, dates, regular expressions, and other object instances, but
|
|
7
|
-
* excludes functions.
|
|
8
|
-
*
|
|
9
|
-
* **Type Narrowing Behavior:**
|
|
10
|
-
*
|
|
11
|
-
* - Narrows `unknown` to `object`
|
|
12
|
-
* - Excludes `null`, `undefined`, and all primitive types
|
|
13
|
-
* - Excludes functions (they have `typeof` === `"function"`, not `"object"`)
|
|
14
|
-
* - Includes arrays, dates, regex, and other object instances
|
|
15
|
-
*
|
|
16
|
-
* **Note:** This function returns `true` for arrays. If you need
|
|
17
|
-
* record-oriented narrowing that excludes arrays, use `isRecord()` instead.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
*
|
|
21
|
-
* ```ts
|
|
22
|
-
* const mixed: readonly unknown[] = [{ id: 1 }, null, 'Ada'] as const;
|
|
23
|
-
*
|
|
24
|
-
* const objects = mixed.filter(isNonNullObject);
|
|
25
|
-
*
|
|
26
|
-
* assert.deepStrictEqual(objects, [{ id: 1 }]);
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* @param u - The value to check
|
|
30
|
-
* @returns `true` if `u` is an object and not `null`, `false` otherwise. When
|
|
31
|
-
* `true`, TypeScript narrows the type to `object`.
|
|
32
|
-
* @see {@link isRecord} - For record-oriented type narrowing (excludes arrays)
|
|
33
|
-
*/
|
|
34
|
-
export declare const isNonNullObject: (u: unknown) => u is object;
|
|
1
|
+
/** Implemented in ts-std-forge since Sumi D-49; re-exported here. */
|
|
2
|
+
export { isNonNullObject } from 'ts-std-forge';
|
|
35
3
|
//# sourceMappingURL=is-non-null-object.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-non-null-object.d.mts","sourceRoot":"","sources":["../../src/guard/is-non-null-object.mts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"is-non-null-object.d.mts","sourceRoot":"","sources":["../../src/guard/is-non-null-object.mts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|