type-plus 7.3.1 → 7.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +146 -183
- package/cjs/any/any_type.d.ts +8 -8
- package/cjs/any/any_type.d.ts.map +1 -1
- package/cjs/array/array.at.d.ts +3 -1
- package/cjs/array/array.at.d.ts.map +1 -1
- package/cjs/array/array.entries.d.ts +4 -3
- package/cjs/array/array.entries.d.ts.map +1 -1
- package/cjs/array/array.find_last.d.ts +3 -1
- package/cjs/array/array.find_last.d.ts.map +1 -1
- package/cjs/array/array.some.d.ts +1 -1
- package/cjs/array/array.some.d.ts.map +1 -1
- package/cjs/array/array_plus.common_prop_keys.d.ts +27 -0
- package/cjs/array/array_plus.common_prop_keys.d.ts.map +1 -0
- package/cjs/array/array_plus.common_prop_keys.js +3 -0
- package/cjs/array/array_plus.common_prop_keys.js.map +1 -0
- package/cjs/array/{array.concat.d.ts → array_plus.concat.d.ts} +4 -1
- package/cjs/array/array_plus.concat.d.ts.map +1 -0
- package/cjs/array/array_plus.concat.js +3 -0
- package/cjs/array/array_plus.concat.js.map +1 -0
- package/cjs/array/array_plus.d.ts +7 -3
- package/cjs/array/array_plus.d.ts.map +1 -1
- package/cjs/array/array_plus.drop_match.d.ts +4 -0
- package/cjs/array/array_plus.drop_match.d.ts.map +1 -0
- package/cjs/array/array_plus.drop_match.js +3 -0
- package/cjs/array/array_plus.drop_match.js.map +1 -0
- package/cjs/array/array_plus.element_match.d.ts +44 -0
- package/cjs/array/array_plus.element_match.d.ts.map +1 -0
- package/cjs/array/array_plus.element_match.js +3 -0
- package/cjs/array/array_plus.element_match.js.map +1 -0
- package/cjs/array/array_plus.filter.d.ts +2 -0
- package/cjs/array/array_plus.filter.d.ts.map +1 -0
- package/cjs/array/array_plus.filter.js +3 -0
- package/cjs/array/array_plus.filter.js.map +1 -0
- package/cjs/array/array_plus.find.d.ts +57 -0
- package/cjs/array/array_plus.find.d.ts.map +1 -0
- package/cjs/array/array_plus.find.js +3 -0
- package/cjs/array/array_plus.find.js.map +1 -0
- package/cjs/array/array_plus.pad_start.d.ts +5 -0
- package/cjs/array/array_plus.pad_start.d.ts.map +1 -0
- package/cjs/array/array_plus.pad_start.js +3 -0
- package/cjs/array/array_plus.pad_start.js.map +1 -0
- package/cjs/array/array_type.d.ts +30 -12
- package/cjs/array/array_type.d.ts.map +1 -1
- package/cjs/array/filter.d.ts +24 -4
- package/cjs/array/filter.d.ts.map +1 -1
- package/cjs/array/find_first.d.ts +62 -0
- package/cjs/array/find_first.d.ts.map +1 -0
- package/cjs/array/{array.find.js → find_first.js} +1 -1
- package/cjs/array/find_first.js.map +1 -0
- package/cjs/array/head.d.ts +30 -1
- package/cjs/array/head.d.ts.map +1 -1
- package/cjs/array/intersect_of_props.d.ts +5 -3
- package/cjs/array/intersect_of_props.d.ts.map +1 -1
- package/cjs/array/last.d.ts +27 -2
- package/cjs/array/last.d.ts.map +1 -1
- package/cjs/array/literal_array.d.ts +5 -0
- package/cjs/array/literal_array.d.ts.map +1 -1
- package/cjs/array/literal_array.js +5 -0
- package/cjs/array/literal_array.js.map +1 -1
- package/cjs/array/pad_start.d.ts +5 -5
- package/cjs/array/pad_start.d.ts.map +1 -1
- package/cjs/array/reduce_while.d.ts +6 -0
- package/cjs/array/reduce_while.d.ts.map +1 -1
- package/cjs/array/reduce_while.js +6 -0
- package/cjs/array/reduce_while.js.map +1 -1
- package/cjs/array/reverse.d.ts +5 -0
- package/cjs/array/reverse.d.ts.map +1 -1
- package/cjs/array/union_of_props.d.ts +1 -1
- package/cjs/array/union_of_props.d.ts.map +1 -1
- package/cjs/assertion/assert_type.d.ts +4 -1
- package/cjs/assertion/assert_type.d.ts.map +1 -1
- package/cjs/assertion/assert_type.js.map +1 -1
- package/cjs/functional/compose.d.ts +2 -1
- package/cjs/functional/compose.d.ts.map +1 -1
- package/cjs/functional/compose.js.map +1 -1
- package/cjs/functional/context.d.ts.map +1 -1
- package/cjs/index.d.ts +22 -3
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +9 -3
- package/cjs/index.js.map +1 -1
- package/cjs/math/numeric_struct.d.ts +1 -1
- package/cjs/math/numeric_struct.d.ts.map +1 -1
- package/cjs/mix_types/any_or_never_type.d.ts +1 -1
- package/cjs/never/never_type.d.ts +11 -0
- package/cjs/never/never_type.d.ts.map +1 -1
- package/cjs/nodejs/isNodeError.d.ts.map +1 -1
- package/cjs/nominal/brand.d.ts.map +1 -1
- package/cjs/nominal/flavor.d.ts.map +1 -1
- package/cjs/object/index.d.ts +0 -1
- package/cjs/object/index.d.ts.map +1 -1
- package/cjs/object/index.js.map +1 -1
- package/cjs/testing/test_type.d.ts +277 -233
- package/cjs/testing/test_type.d.ts.map +1 -1
- package/cjs/testing/test_type.js.map +1 -1
- package/cjs/tuple/common_prop_keys.d.ts +34 -0
- package/cjs/tuple/common_prop_keys.d.ts.map +1 -0
- package/cjs/tuple/common_prop_keys.js.map +1 -0
- package/cjs/tuple/create_tuple.d.ts.map +1 -1
- package/cjs/tuple/drop.d.ts +91 -0
- package/cjs/tuple/drop.d.ts.map +1 -0
- package/cjs/{array → tuple}/drop.js +3 -1
- package/cjs/tuple/drop.js.map +1 -0
- package/{esm/array → cjs/tuple}/tail.d.ts +1 -1
- package/cjs/{array → tuple}/tail.d.ts.map +1 -1
- package/cjs/{array → tuple}/tail.js.map +1 -1
- package/cjs/tuple/tuple_plus.common_prop_keys.d.ts +28 -0
- package/cjs/tuple/tuple_plus.common_prop_keys.d.ts.map +1 -0
- package/cjs/tuple/tuple_plus.common_prop_keys.js +3 -0
- package/cjs/tuple/tuple_plus.common_prop_keys.js.map +1 -0
- package/cjs/tuple/tuple_plus.d.ts +5 -1
- package/cjs/tuple/tuple_plus.d.ts.map +1 -1
- package/cjs/tuple/tuple_plus.drop_match.d.ts +6 -0
- package/cjs/tuple/tuple_plus.drop_match.d.ts.map +1 -0
- package/cjs/tuple/tuple_plus.drop_match.js +3 -0
- package/cjs/tuple/tuple_plus.drop_match.js.map +1 -0
- package/cjs/tuple/tuple_plus.filter.d.ts +13 -0
- package/cjs/tuple/tuple_plus.filter.d.ts.map +1 -0
- package/cjs/tuple/tuple_plus.filter.js +3 -0
- package/cjs/tuple/tuple_plus.filter.js.map +1 -0
- package/cjs/tuple/tuple_plus.find.d.ts +64 -0
- package/cjs/tuple/tuple_plus.find.d.ts.map +1 -0
- package/cjs/tuple/tuple_plus.find.js +3 -0
- package/cjs/tuple/tuple_plus.find.js.map +1 -0
- package/cjs/tuple/tuple_plus.js +0 -15
- package/cjs/tuple/tuple_plus.js.map +1 -1
- package/cjs/tuple/tuple_plus.pad_start.d.ts +11 -5
- package/cjs/tuple/tuple_plus.pad_start.d.ts.map +1 -1
- package/cjs/tuple/tuple_type.d.ts +41 -23
- package/cjs/tuple/tuple_type.d.ts.map +1 -1
- package/cjs/union/union.d.ts +33 -0
- package/cjs/union/union.d.ts.map +1 -0
- package/cjs/{array/array.concat.js → union/union.js} +1 -1
- package/cjs/union/union.js.map +1 -0
- package/cjs/unknown/unknown_type.d.ts +12 -0
- package/cjs/unknown/unknown_type.d.ts.map +1 -1
- package/cjs/utils/options.d.ts +10 -0
- package/cjs/utils/options.d.ts.map +1 -0
- package/cjs/utils/options.js +3 -0
- package/cjs/utils/options.js.map +1 -0
- package/esm/any/any_type.d.ts +8 -8
- package/esm/any/any_type.d.ts.map +1 -1
- package/esm/array/array.at.d.ts +3 -1
- package/esm/array/array.at.d.ts.map +1 -1
- package/esm/array/array.entries.d.ts +4 -3
- package/esm/array/array.entries.d.ts.map +1 -1
- package/esm/array/array.find_last.d.ts +3 -1
- package/esm/array/array.find_last.d.ts.map +1 -1
- package/esm/array/array.some.d.ts +1 -1
- package/esm/array/array.some.d.ts.map +1 -1
- package/esm/array/array_plus.common_prop_keys.d.ts +27 -0
- package/esm/array/array_plus.common_prop_keys.d.ts.map +1 -0
- package/esm/array/array_plus.common_prop_keys.js +2 -0
- package/esm/array/array_plus.common_prop_keys.js.map +1 -0
- package/esm/array/{array.concat.d.ts → array_plus.concat.d.ts} +4 -1
- package/esm/array/array_plus.concat.d.ts.map +1 -0
- package/esm/array/array_plus.concat.js +2 -0
- package/esm/array/array_plus.concat.js.map +1 -0
- package/esm/array/array_plus.d.ts +7 -3
- package/esm/array/array_plus.d.ts.map +1 -1
- package/esm/array/array_plus.drop_match.d.ts +4 -0
- package/esm/array/array_plus.drop_match.d.ts.map +1 -0
- package/esm/array/array_plus.drop_match.js +2 -0
- package/esm/array/array_plus.drop_match.js.map +1 -0
- package/esm/array/array_plus.element_match.d.ts +44 -0
- package/esm/array/array_plus.element_match.d.ts.map +1 -0
- package/esm/array/array_plus.element_match.js +2 -0
- package/esm/array/array_plus.element_match.js.map +1 -0
- package/esm/array/array_plus.filter.d.ts +2 -0
- package/esm/array/array_plus.filter.d.ts.map +1 -0
- package/esm/array/array_plus.filter.js +2 -0
- package/esm/array/array_plus.filter.js.map +1 -0
- package/esm/array/array_plus.find.d.ts +57 -0
- package/esm/array/array_plus.find.d.ts.map +1 -0
- package/esm/array/array_plus.find.js +2 -0
- package/esm/array/array_plus.find.js.map +1 -0
- package/esm/array/array_plus.pad_start.d.ts +5 -0
- package/esm/array/array_plus.pad_start.d.ts.map +1 -0
- package/esm/array/array_plus.pad_start.js +2 -0
- package/esm/array/array_plus.pad_start.js.map +1 -0
- package/esm/array/array_type.d.ts +30 -12
- package/esm/array/array_type.d.ts.map +1 -1
- package/esm/array/filter.d.ts +24 -4
- package/esm/array/filter.d.ts.map +1 -1
- package/esm/array/find_first.d.ts +62 -0
- package/esm/array/find_first.d.ts.map +1 -0
- package/esm/array/find_first.js +2 -0
- package/esm/array/find_first.js.map +1 -0
- package/esm/array/head.d.ts +30 -1
- package/esm/array/head.d.ts.map +1 -1
- package/esm/array/intersect_of_props.d.ts +5 -3
- package/esm/array/intersect_of_props.d.ts.map +1 -1
- package/esm/array/last.d.ts +27 -2
- package/esm/array/last.d.ts.map +1 -1
- package/esm/array/literal_array.d.ts +5 -0
- package/esm/array/literal_array.d.ts.map +1 -1
- package/esm/array/literal_array.js +5 -0
- package/esm/array/literal_array.js.map +1 -1
- package/esm/array/pad_start.d.ts +5 -5
- package/esm/array/pad_start.d.ts.map +1 -1
- package/esm/array/reduce_while.d.ts +6 -0
- package/esm/array/reduce_while.d.ts.map +1 -1
- package/esm/array/reduce_while.js +6 -0
- package/esm/array/reduce_while.js.map +1 -1
- package/esm/array/reverse.d.ts +5 -0
- package/esm/array/reverse.d.ts.map +1 -1
- package/esm/array/union_of_props.d.ts +1 -1
- package/esm/array/union_of_props.d.ts.map +1 -1
- package/esm/assertion/assert_type.d.ts +4 -1
- package/esm/assertion/assert_type.d.ts.map +1 -1
- package/esm/assertion/assert_type.js.map +1 -1
- package/esm/functional/compose.d.ts +2 -1
- package/esm/functional/compose.d.ts.map +1 -1
- package/esm/functional/compose.js.map +1 -1
- package/esm/functional/context.d.ts.map +1 -1
- package/esm/index.d.ts +22 -3
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +4 -2
- package/esm/index.js.map +1 -1
- package/esm/math/numeric_struct.d.ts +1 -1
- package/esm/math/numeric_struct.d.ts.map +1 -1
- package/esm/mix_types/any_or_never_type.d.ts +1 -1
- package/esm/never/never_type.d.ts +11 -0
- package/esm/never/never_type.d.ts.map +1 -1
- package/esm/nodejs/isNodeError.d.ts.map +1 -1
- package/esm/nominal/brand.d.ts.map +1 -1
- package/esm/nominal/flavor.d.ts.map +1 -1
- package/esm/object/index.d.ts +0 -1
- package/esm/object/index.d.ts.map +1 -1
- package/esm/object/index.js.map +1 -1
- package/esm/testing/test_type.d.ts +277 -233
- package/esm/testing/test_type.d.ts.map +1 -1
- package/esm/testing/test_type.js.map +1 -1
- package/esm/tuple/common_prop_keys.d.ts +34 -0
- package/esm/tuple/common_prop_keys.d.ts.map +1 -0
- package/esm/tuple/common_prop_keys.js.map +1 -0
- package/esm/tuple/create_tuple.d.ts.map +1 -1
- package/esm/tuple/drop.d.ts +91 -0
- package/esm/tuple/drop.d.ts.map +1 -0
- package/esm/tuple/drop.js +9 -0
- package/esm/tuple/drop.js.map +1 -0
- package/{cjs/array → esm/tuple}/tail.d.ts +1 -1
- package/esm/{array → tuple}/tail.d.ts.map +1 -1
- package/esm/{array → tuple}/tail.js.map +1 -1
- package/esm/tuple/tuple_plus.common_prop_keys.d.ts +28 -0
- package/esm/tuple/tuple_plus.common_prop_keys.d.ts.map +1 -0
- package/esm/tuple/tuple_plus.common_prop_keys.js +2 -0
- package/esm/tuple/tuple_plus.common_prop_keys.js.map +1 -0
- package/esm/tuple/tuple_plus.d.ts +5 -1
- package/esm/tuple/tuple_plus.d.ts.map +1 -1
- package/esm/tuple/tuple_plus.drop_match.d.ts +6 -0
- package/esm/tuple/tuple_plus.drop_match.d.ts.map +1 -0
- package/esm/tuple/tuple_plus.drop_match.js +2 -0
- package/esm/tuple/tuple_plus.drop_match.js.map +1 -0
- package/esm/tuple/tuple_plus.filter.d.ts +13 -0
- package/esm/tuple/tuple_plus.filter.d.ts.map +1 -0
- package/esm/tuple/tuple_plus.filter.js +2 -0
- package/esm/tuple/tuple_plus.filter.js.map +1 -0
- package/esm/tuple/tuple_plus.find.d.ts +64 -0
- package/esm/tuple/tuple_plus.find.d.ts.map +1 -0
- package/esm/tuple/tuple_plus.find.js +2 -0
- package/esm/tuple/tuple_plus.find.js.map +1 -0
- package/esm/tuple/tuple_plus.js +1 -1
- package/esm/tuple/tuple_plus.js.map +1 -1
- package/esm/tuple/tuple_plus.pad_start.d.ts +11 -5
- package/esm/tuple/tuple_plus.pad_start.d.ts.map +1 -1
- package/esm/tuple/tuple_type.d.ts +41 -23
- package/esm/tuple/tuple_type.d.ts.map +1 -1
- package/esm/union/union.d.ts +33 -0
- package/esm/union/union.d.ts.map +1 -0
- package/esm/union/union.js +2 -0
- package/esm/union/union.js.map +1 -0
- package/esm/unknown/unknown_type.d.ts +12 -0
- package/esm/unknown/unknown_type.d.ts.map +1 -1
- package/esm/utils/options.d.ts +10 -0
- package/esm/utils/options.d.ts.map +1 -0
- package/esm/utils/options.js +2 -0
- package/esm/utils/options.js.map +1 -0
- package/package.json +12 -9
- package/ts/any/any_type.ts +8 -9
- package/ts/any/readme.md +71 -4
- package/ts/array/array.at.ts +3 -1
- package/ts/array/array.entries.ts +4 -2
- package/ts/array/array.find_last.ts +3 -1
- package/ts/array/array.some.ts +1 -1
- package/ts/array/array_plus.common_prop_keys.ts +35 -0
- package/ts/array/{array.concat.ts → array_plus.concat.ts} +3 -0
- package/ts/array/array_plus.drop_match.ts +16 -0
- package/ts/array/array_plus.element_match.ts +61 -0
- package/ts/array/array_plus.filter.ts +5 -0
- package/ts/array/array_plus.find.ts +71 -0
- package/ts/array/array_plus.pad_start.ts +13 -0
- package/ts/array/array_plus.ts +7 -3
- package/ts/array/array_type.ts +30 -12
- package/ts/array/filter.ts +27 -22
- package/ts/array/find_first.ts +71 -0
- package/ts/array/head.ts +40 -1
- package/ts/array/intersect_of_props.ts +7 -3
- package/ts/array/last.ts +36 -2
- package/ts/array/literal_array.ts +5 -0
- package/ts/array/pad_start.ts +6 -10
- package/ts/array/readme.md +297 -32
- package/ts/array/reduce_while.ts +6 -0
- package/ts/array/reverse.ts +5 -0
- package/ts/array/union_of_props.ts +1 -1
- package/ts/assertion/assert_type.ts +4 -1
- package/ts/assertion/readme.md +4 -3
- package/ts/functional/compose.ts +2 -1
- package/ts/functional/context.ts +1 -1
- package/ts/index.ts +22 -3
- package/ts/math/numeric_struct.ts +9 -9
- package/ts/mix_types/any_or_never_type.ts +1 -1
- package/ts/mix_types/readme.md +7 -1
- package/ts/never/never_type.ts +13 -0
- package/ts/nodejs/isNodeError.ts +13 -13
- package/ts/nominal/brand.ts +1 -1
- package/ts/nominal/flavor.ts +1 -1
- package/ts/object/index.ts +0 -1
- package/ts/testing/readme.md +30 -0
- package/ts/testing/test_type.ts +279 -234
- package/ts/tuple/common_prop_keys.ts +41 -0
- package/ts/tuple/create_tuple.ts +9 -9
- package/ts/tuple/drop.ts +125 -0
- package/ts/tuple/readme.md +263 -9
- package/ts/{array → tuple}/tail.ts +1 -1
- package/ts/tuple/tuple_plus.common_prop_keys.ts +47 -0
- package/ts/tuple/tuple_plus.drop_match.ts +20 -0
- package/ts/tuple/tuple_plus.filter.ts +29 -0
- package/ts/tuple/tuple_plus.find.ts +88 -0
- package/ts/tuple/tuple_plus.pad_start.ts +37 -21
- package/ts/tuple/tuple_plus.ts +5 -1
- package/ts/tuple/tuple_type.ts +67 -25
- package/ts/union/readme.md +81 -0
- package/ts/union/union.ts +37 -0
- package/ts/unknown/unknown_type.ts +13 -0
- package/ts/utils/options.ts +10 -0
- package/cjs/array/array.concat.d.ts.map +0 -1
- package/cjs/array/array.concat.js.map +0 -1
- package/cjs/array/array.find.d.ts +0 -21
- package/cjs/array/array.find.d.ts.map +0 -1
- package/cjs/array/array.find.js.map +0 -1
- package/cjs/array/common_prop_keys.d.ts +0 -11
- package/cjs/array/common_prop_keys.d.ts.map +0 -1
- package/cjs/array/common_prop_keys.js.map +0 -1
- package/cjs/array/drop.d.ts +0 -19
- package/cjs/array/drop.d.ts.map +0 -1
- package/cjs/array/drop.js.map +0 -1
- package/cjs/array/index.d.ts +0 -17
- package/cjs/array/index.d.ts.map +0 -1
- package/cjs/array/index.js +0 -33
- package/cjs/array/index.js.map +0 -1
- package/esm/array/array.concat.d.ts.map +0 -1
- package/esm/array/array.concat.js +0 -2
- package/esm/array/array.concat.js.map +0 -1
- package/esm/array/array.find.d.ts +0 -21
- package/esm/array/array.find.d.ts.map +0 -1
- package/esm/array/array.find.js +0 -2
- package/esm/array/array.find.js.map +0 -1
- package/esm/array/common_prop_keys.d.ts +0 -11
- package/esm/array/common_prop_keys.d.ts.map +0 -1
- package/esm/array/common_prop_keys.js.map +0 -1
- package/esm/array/drop.d.ts +0 -19
- package/esm/array/drop.d.ts.map +0 -1
- package/esm/array/drop.js +0 -7
- package/esm/array/drop.js.map +0 -1
- package/esm/array/index.d.ts +0 -17
- package/esm/array/index.d.ts.map +0 -1
- package/esm/array/index.js +0 -17
- package/esm/array/index.js.map +0 -1
- package/ts/array/array.find.ts +0 -32
- package/ts/array/common_prop_keys.ts +0 -18
- package/ts/array/drop.ts +0 -71
- package/ts/array/index.ts +0 -16
- /package/cjs/{array → tuple}/common_prop_keys.js +0 -0
- /package/cjs/{array → tuple}/tail.js +0 -0
- /package/esm/{array → tuple}/common_prop_keys.js +0 -0
- /package/esm/{array → tuple}/tail.js +0 -0
package/ts/index.ts
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
export type { AnyType, IsAny, IsNotAny, NotAnyType } from './any/any_type.js'
|
|
2
2
|
export type { At } from './array/array.at.js'
|
|
3
|
-
export type {
|
|
3
|
+
export type { FindLast } from './array/array.find_last.js'
|
|
4
|
+
export type { Some } from './array/array.some.js'
|
|
5
|
+
export type { Concat } from './array/array_plus.concat.js'
|
|
4
6
|
export * as ArrayPlus from './array/array_plus.js'
|
|
5
7
|
export type { ArrayType, IsArray, IsNotArray, NotArrayType } from './array/array_type.js'
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
+
export type { Filter, KeepMatch } from './array/filter.js'
|
|
9
|
+
export type { FindFirst } from './array/find_first.js'
|
|
10
|
+
export type { Head } from './array/head.js'
|
|
11
|
+
export type { IntersectOfProps, MapToProp } from './array/intersect_of_props.js'
|
|
12
|
+
export type { Last } from './array/last.js'
|
|
13
|
+
export { literalArray } from './array/literal_array.js'
|
|
14
|
+
export type { PadStart } from './array/pad_start.js'
|
|
15
|
+
export { reduceWhile } from './array/reduce_while.js'
|
|
16
|
+
export type { Reverse } from './array/reverse.js'
|
|
17
|
+
export type { PropUnion, UnionOfProps } from './array/union_of_props.js'
|
|
18
|
+
export type { UnionOfValues } from './array/union_of_values.js'
|
|
19
|
+
export { assertType } from './assertion/assert_type.js'
|
|
8
20
|
export type { BigintType, IsBigint, IsNotBigint, NotBigintType } from './bigint/bigint_type.js'
|
|
9
21
|
export type { StringToBigint } from './bigint/cast.js'
|
|
10
22
|
export type {
|
|
@@ -65,6 +77,7 @@ export type {
|
|
|
65
77
|
Zero
|
|
66
78
|
} from './numeric/numeric_type.js'
|
|
67
79
|
export type { IsNotPositive, IsPositive, NonPositive, Positive } from './numeric/positive.js'
|
|
80
|
+
export type { Required, RequiredExcept, RequiredPick } from './object/Required.js'
|
|
68
81
|
export * from './object/index.js'
|
|
69
82
|
export type { IsNotObject, IsObject, NotObjectType, ObjectType } from './object/object_type.js'
|
|
70
83
|
export * from './predicates/index.js'
|
|
@@ -82,7 +95,11 @@ export type { IsNotString, IsString, NotStringType, StringType } from './string/
|
|
|
82
95
|
export type { IsNotSymbol, IsSymbol, NotSymbolType, SymbolType } from './symbol/symbol_type.js'
|
|
83
96
|
export * from './testing/stub.js'
|
|
84
97
|
export * from './testing/test_type.js'
|
|
98
|
+
export type { CommonKeys, CommonPropKeys } from './tuple/common_prop_keys.js'
|
|
85
99
|
export * from './tuple/create_tuple.js'
|
|
100
|
+
export { drop } from './tuple/drop.js'
|
|
101
|
+
export type { DropFirst, DropLast, DropMatch, DropNull, DropNullable, DropUndefined } from './tuple/drop.js'
|
|
102
|
+
export type { Tail } from './tuple/tail.js'
|
|
86
103
|
export * as TuplePlus from './tuple/tuple_plus.js'
|
|
87
104
|
export type { IsNotTuple, IsTuple, NotTupleType, TupleType } from './tuple/tuple_type.js'
|
|
88
105
|
export * from './type-guard/is_type.js'
|
|
@@ -94,9 +111,11 @@ export type {
|
|
|
94
111
|
NotUndefinedType,
|
|
95
112
|
UndefinedType
|
|
96
113
|
} from './undefined/undefined_type.js'
|
|
114
|
+
export type { IsUnion, UnionType } from './union/union.js'
|
|
97
115
|
export type { UnionKeys } from './union_keys.js'
|
|
98
116
|
export type { IsNotUnknown, IsUnknown, NotUnknownType, UnknownType } from './unknown/unknown_type.js'
|
|
99
117
|
export * from './unpartial.js'
|
|
100
118
|
export * from './utils/index.js'
|
|
119
|
+
export type { MergeOptions as MergeCases } from './utils/options.js'
|
|
101
120
|
export type { IsNotVoid, IsVoid, NotVoidType, VoidType } from './void/void_type.js'
|
|
102
121
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Tail } from '../
|
|
1
|
+
import type { Tail } from '../tuple/tail.js'
|
|
2
2
|
import type { PadStart } from '../tuple/tuple_plus.pad_start.js'
|
|
3
3
|
import type { Add as NumericAdd } from './add.js'
|
|
4
4
|
import type { ToNegative } from './math_plus.to_negative.js'
|
|
@@ -631,14 +631,14 @@ export namespace Digit {
|
|
|
631
631
|
][A][B]
|
|
632
632
|
|
|
633
633
|
export type Plus10 = { [k in number]: number } & {
|
|
634
|
-
'-1': 9
|
|
635
|
-
'-2': 8
|
|
636
|
-
'-3': 7
|
|
637
|
-
'-4': 6
|
|
638
|
-
'-5': 5
|
|
639
|
-
'-6': 4
|
|
640
|
-
'-7': 3
|
|
641
|
-
'-8': 2
|
|
634
|
+
'-1': 9,
|
|
635
|
+
'-2': 8,
|
|
636
|
+
'-3': 7,
|
|
637
|
+
'-4': 6,
|
|
638
|
+
'-5': 5,
|
|
639
|
+
'-6': 4,
|
|
640
|
+
'-7': 3,
|
|
641
|
+
'-8': 2,
|
|
642
642
|
'-9': 1
|
|
643
643
|
}
|
|
644
644
|
export type Multiply<A extends number, B extends number> = [
|
package/ts/mix_types/readme.md
CHANGED
|
@@ -6,7 +6,10 @@ This folder contains types and utilities that work across multiple types.
|
|
|
6
6
|
|
|
7
7
|
`AnyOrNeverType<T, Then = T, Else = never>` 🎭 🩳
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Filter `T` to ensure it is either exactly `any` or exactly `never`.
|
|
10
|
+
|
|
11
|
+
🌪️ *filter*
|
|
12
|
+
🩳 *shortcut*
|
|
10
13
|
|
|
11
14
|
```ts
|
|
12
15
|
import type { AnyOrNeverType } from 'type-plus'
|
|
@@ -24,6 +27,9 @@ type R = AnyOrNeverType<unknown, 1, 2> // 2
|
|
|
24
27
|
|
|
25
28
|
Validate if `T` is either exactly `any` or exactly `never`.
|
|
26
29
|
|
|
30
|
+
🎭 *validate*
|
|
31
|
+
🩳 *shortcut*
|
|
32
|
+
|
|
27
33
|
```ts
|
|
28
34
|
import type { IsAnyOrNever } from 'type-plus'
|
|
29
35
|
|
package/ts/never/never_type.ts
CHANGED
|
@@ -55,3 +55,16 @@ export type IsNever<T, Then = true, Else = false> = NeverType<T, Then, Else>
|
|
|
55
55
|
* type R = IsNotNever<never> // false
|
|
56
56
|
*/
|
|
57
57
|
export type IsNotNever<T, Then = true, Else = false> = NeverType<T, Else, Then>
|
|
58
|
+
|
|
59
|
+
export namespace NeverType {
|
|
60
|
+
/**
|
|
61
|
+
* Type options when input type is `never`.
|
|
62
|
+
*/
|
|
63
|
+
export interface Options {
|
|
64
|
+
caseNever?: unknown
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface DefaultOptions {
|
|
68
|
+
caseNever: never
|
|
69
|
+
}
|
|
70
|
+
}
|
package/ts/nodejs/isNodeError.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export type SystemErrors = {
|
|
2
|
-
EACCES: Error & { code: 'EACCES' }
|
|
3
|
-
EADDRINUSE: Error & { code: 'EADDRINUSE' }
|
|
4
|
-
ECONNREFUSED: Error
|
|
5
|
-
ECONNRESET: Error
|
|
6
|
-
EEXIST: Error
|
|
7
|
-
EISDIR: Error
|
|
8
|
-
EMFILE: Error
|
|
9
|
-
ENOENT: Error & { code: 'ENOENT'
|
|
10
|
-
ENOTDIR: Error
|
|
11
|
-
ENOTEMPTY: Error
|
|
12
|
-
ENOTFOUND: Error
|
|
13
|
-
EPERM: Error
|
|
14
|
-
EPIPE: Error
|
|
2
|
+
EACCES: Error & { code: 'EACCES' },
|
|
3
|
+
EADDRINUSE: Error & { code: 'EADDRINUSE' },
|
|
4
|
+
ECONNREFUSED: Error,
|
|
5
|
+
ECONNRESET: Error,
|
|
6
|
+
EEXIST: Error,
|
|
7
|
+
EISDIR: Error,
|
|
8
|
+
EMFILE: Error,
|
|
9
|
+
ENOENT: Error & { code: 'ENOENT', path: string },
|
|
10
|
+
ENOTDIR: Error,
|
|
11
|
+
ENOTEMPTY: Error,
|
|
12
|
+
ENOTFOUND: Error,
|
|
13
|
+
EPERM: Error,
|
|
14
|
+
EPIPE: Error,
|
|
15
15
|
ETIMEDOUT: Error
|
|
16
16
|
}
|
|
17
17
|
|
package/ts/nominal/brand.ts
CHANGED
package/ts/nominal/flavor.ts
CHANGED
package/ts/object/index.ts
CHANGED
|
@@ -12,7 +12,6 @@ export type { Partial, PartialExcept, PartialOmit, PartialPick } from './Partial
|
|
|
12
12
|
export type * from './optional_key.js'
|
|
13
13
|
export type { RecursiveIntersect } from './RecursiveIntersect.js'
|
|
14
14
|
export type { RecursiveRequired } from './RecursiveRequired.js'
|
|
15
|
-
export type { RequiredExcept, RequiredPick } from './Required.js'
|
|
16
15
|
export type { RequiredKeys } from './RequiredKeys.js'
|
|
17
16
|
export type { SpreadRecord } from './SpreadRecord.js'
|
|
18
17
|
export type { ValueOf } from './ValueOf.js'
|
package/ts/testing/readme.md
CHANGED
|
@@ -16,4 +16,34 @@ import { testType } from 'type-plus'
|
|
|
16
16
|
testType.any<T>(true) // T is `any`
|
|
17
17
|
testType.equal<A, B>(true) // A is equal to B
|
|
18
18
|
testType.never<T>(false) // T is not `never`
|
|
19
|
+
|
|
20
|
+
const t = testType.equal<SomeComplexType, SomeCompositeType>(true)
|
|
21
|
+
type T = typeof t // type resolution
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## [testType.inspect](./test_type.ts)
|
|
25
|
+
|
|
26
|
+
`testType.inspect<T>(fn)`
|
|
27
|
+
|
|
28
|
+
A quick way to inspect a type.
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { testType } from 'type-plus'
|
|
32
|
+
|
|
33
|
+
testType.inspect<SomeType>(t => {
|
|
34
|
+
type T = typeof t.type // type resolution
|
|
35
|
+
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
It also provides additional methods and predefined inspections so that you can quickly check how the type behaves in specific cases.
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { testType } from 'type-plus'
|
|
42
|
+
|
|
43
|
+
testType.inspect<SomeType>(t => {
|
|
44
|
+
t.extends<AnotherType>() // true or false
|
|
45
|
+
t.union<number>() // SomeType | number`
|
|
46
|
+
t.intersect<string>() // `SomeType & string`
|
|
47
|
+
t.extends_boolean // true or false
|
|
48
|
+
})
|
|
19
49
|
```
|