type-plus 6.3.0 → 6.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 +36 -9
- package/cjs/any/any_or_never.d.ts +17 -0
- package/cjs/any/any_or_never.d.ts.map +1 -0
- package/cjs/any/any_or_never.js +3 -0
- package/cjs/any/any_or_never.js.map +1 -0
- package/cjs/any/any_type.d.ts +57 -0
- package/cjs/any/any_type.d.ts.map +1 -0
- package/cjs/any/any_type.js +3 -0
- package/cjs/any/any_type.js.map +1 -0
- package/cjs/array/array.d.ts +32 -0
- package/cjs/array/array.d.ts.map +1 -0
- package/cjs/array/array.js.map +1 -0
- package/cjs/array/array_index.d.ts +37 -0
- package/cjs/array/array_index.d.ts.map +1 -0
- package/cjs/array/array_index.js +3 -0
- package/cjs/array/array_index.js.map +1 -0
- package/cjs/array/array_plus.d.ts +3 -0
- package/cjs/array/array_plus.d.ts.map +1 -0
- package/cjs/array/array_plus.js.map +1 -0
- package/cjs/array/array_type.d.ts +56 -0
- package/cjs/array/array_type.d.ts.map +1 -0
- package/cjs/array/array_type.js +3 -0
- package/cjs/array/array_type.js.map +1 -0
- package/cjs/array/common_prop_keys.d.ts.map +1 -0
- package/cjs/array/common_prop_keys.js.map +1 -0
- package/cjs/array/create_tuple.d.ts +11 -0
- package/cjs/array/create_tuple.d.ts.map +1 -0
- package/cjs/array/create_tuple.js.map +1 -0
- package/cjs/array/drop.d.ts +19 -0
- package/cjs/array/drop.d.ts.map +1 -0
- package/cjs/array/drop.js.map +1 -0
- package/cjs/array/filter.d.ts +9 -0
- package/cjs/array/filter.d.ts.map +1 -0
- package/cjs/array/filter.js.map +1 -0
- package/cjs/array/find_first.d.ts.map +1 -0
- package/cjs/array/find_first.js.map +1 -0
- package/cjs/array/find_last.d.ts.map +1 -0
- package/cjs/array/find_last.js.map +1 -0
- package/cjs/array/head.d.ts.map +1 -0
- package/cjs/array/head.js.map +1 -0
- package/cjs/array/index.d.ts +18 -0
- package/cjs/array/index.d.ts.map +1 -0
- package/cjs/array/index.js +34 -0
- package/cjs/array/index.js.map +1 -0
- package/cjs/array/intersect_of_props.d.ts.map +1 -0
- package/cjs/array/intersect_of_props.js.map +1 -0
- package/cjs/array/last.d.ts.map +1 -0
- package/cjs/array/last.js.map +1 -0
- package/cjs/array/literal_array.d.ts.map +1 -0
- package/cjs/array/literal_array.js.map +1 -0
- package/cjs/array/pad_left.d.ts +6 -0
- package/cjs/array/pad_left.d.ts.map +1 -0
- package/cjs/array/pad_left.js.map +1 -0
- package/cjs/array/reduce_while.d.ts.map +1 -0
- package/cjs/array/reduce_while.js.map +1 -0
- package/cjs/array/reverse.d.ts.map +1 -0
- package/cjs/array/reverse.js.map +1 -0
- package/cjs/array/some.d.ts +8 -0
- package/cjs/array/some.d.ts.map +1 -0
- package/cjs/array/some.js.map +1 -0
- package/cjs/array/tail.d.ts.map +1 -0
- package/cjs/array/tail.js.map +1 -0
- package/cjs/array/union_of_props.d.ts.map +1 -0
- package/cjs/array/union_of_props.js.map +1 -0
- package/cjs/array/union_of_values.d.ts.map +1 -0
- package/cjs/array/union_of_values.js.map +1 -0
- package/cjs/assertion/assert_type.d.ts +34 -0
- package/cjs/assertion/assert_type.d.ts.map +1 -0
- package/cjs/assertion/assert_type.js +107 -0
- package/cjs/assertion/assert_type.js.map +1 -0
- package/cjs/bigint/bigint_type.d.ts +62 -0
- package/cjs/bigint/bigint_type.d.ts.map +1 -0
- package/cjs/bigint/bigint_type.js +3 -0
- package/cjs/bigint/bigint_type.js.map +1 -0
- package/cjs/bigint/strict_bigint_type.d.ts +64 -0
- package/cjs/bigint/strict_bigint_type.d.ts.map +1 -0
- package/cjs/bigint/strict_bigint_type.js +3 -0
- package/cjs/bigint/strict_bigint_type.js.map +1 -0
- package/cjs/boolean/boolean_type.d.ts +64 -0
- package/cjs/boolean/boolean_type.d.ts.map +1 -0
- package/cjs/boolean/boolean_type.js +3 -0
- package/cjs/boolean/boolean_type.js.map +1 -0
- package/cjs/boolean/false_type.d.ts +57 -0
- package/cjs/boolean/false_type.d.ts.map +1 -0
- package/cjs/boolean/false_type.js +3 -0
- package/cjs/boolean/false_type.js.map +1 -0
- package/cjs/boolean/strict_boolean_type.d.ts +61 -0
- package/cjs/boolean/strict_boolean_type.d.ts.map +1 -0
- package/cjs/boolean/strict_boolean_type.js +3 -0
- package/cjs/boolean/strict_boolean_type.js.map +1 -0
- package/cjs/boolean/true_type.d.ts +57 -0
- package/cjs/boolean/true_type.d.ts.map +1 -0
- package/cjs/boolean/true_type.js +3 -0
- package/cjs/boolean/true_type.js.map +1 -0
- package/cjs/composable_types.d.ts +9 -0
- package/cjs/composable_types.d.ts.map +1 -0
- package/cjs/composable_types.js +3 -0
- package/cjs/composable_types.js.map +1 -0
- package/cjs/equal/equal.d.ts +52 -0
- package/cjs/equal/equal.d.ts.map +1 -0
- package/cjs/equal/equal.js +3 -0
- package/cjs/equal/equal.js.map +1 -0
- package/cjs/function/any_function.d.ts +2 -0
- package/cjs/function/any_function.d.ts.map +1 -0
- package/cjs/function/any_function.js +3 -0
- package/cjs/function/any_function.js.map +1 -0
- package/cjs/function/extract_function.d.ts +24 -0
- package/cjs/function/extract_function.d.ts.map +1 -0
- package/cjs/function/extract_function.js +13 -0
- package/cjs/function/extract_function.js.map +1 -0
- package/cjs/function/function_type.d.ts +67 -0
- package/cjs/function/function_type.d.ts.map +1 -0
- package/cjs/function/function_type.js +3 -0
- package/cjs/function/function_type.js.map +1 -0
- package/cjs/function/strict_function_type.d.ts +57 -0
- package/cjs/function/strict_function_type.d.ts.map +1 -0
- package/cjs/function/strict_function_type.js +3 -0
- package/cjs/function/strict_function_type.js.map +1 -0
- package/cjs/functional/Maybe.d.ts +2 -2
- package/cjs/functional/Maybe.d.ts.map +1 -1
- package/cjs/functional/compose.d.ts +2 -2
- package/cjs/functional/compose.d.ts.map +1 -1
- package/cjs/index.d.ts +44 -15
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +11 -15
- package/cjs/index.js.map +1 -1
- package/cjs/json.d.ts +12 -0
- package/cjs/json.d.ts.map +1 -0
- package/cjs/json.js +14 -0
- package/cjs/json.js.map +1 -0
- package/cjs/math/Add.d.ts +4 -3
- package/cjs/math/Add.d.ts.map +1 -1
- package/cjs/math/Digit.d.ts +4 -3
- package/cjs/math/Digit.d.ts.map +1 -1
- package/cjs/math/GreaterThan.d.ts +6 -4
- package/cjs/math/GreaterThan.d.ts.map +1 -1
- package/cjs/math/Max.d.ts +1 -1
- package/cjs/math/Max.d.ts.map +1 -1
- package/cjs/math/Subtract.d.ts +4 -3
- package/cjs/math/Subtract.d.ts.map +1 -1
- package/cjs/never/never_type.d.ts +59 -0
- package/cjs/never/never_type.d.ts.map +1 -0
- package/cjs/never/never_type.js +3 -0
- package/cjs/never/never_type.js.map +1 -0
- package/cjs/nominal/brand.d.ts +23 -0
- package/cjs/nominal/brand.d.ts.map +1 -0
- package/cjs/nominal/brand.js +20 -0
- package/cjs/nominal/brand.js.map +1 -0
- package/cjs/nominal/constants.d.ts +3 -0
- package/cjs/nominal/constants.d.ts.map +1 -0
- package/cjs/nominal/constants.js +6 -0
- package/cjs/nominal/constants.js.map +1 -0
- package/cjs/nominal/flavor.d.ts +31 -0
- package/cjs/nominal/flavor.d.ts.map +1 -0
- package/cjs/nominal/flavor.js +20 -0
- package/cjs/nominal/flavor.js.map +1 -0
- package/cjs/nominal/index.d.ts +4 -0
- package/cjs/nominal/index.d.ts.map +1 -0
- package/cjs/nominal/index.js +20 -0
- package/cjs/nominal/index.js.map +1 -0
- package/cjs/nominal/nominal_match.d.ts +5 -0
- package/cjs/nominal/nominal_match.d.ts.map +1 -0
- package/cjs/nominal/nominal_match.js +13 -0
- package/cjs/nominal/nominal_match.js.map +1 -0
- package/cjs/null/null_type.d.ts +58 -0
- package/cjs/null/null_type.d.ts.map +1 -0
- package/cjs/null/null_type.js +3 -0
- package/cjs/null/null_type.js.map +1 -0
- package/cjs/number/integer.d.ts +75 -0
- package/cjs/number/integer.d.ts.map +1 -0
- package/cjs/number/integer.js +3 -0
- package/cjs/number/integer.js.map +1 -0
- package/cjs/number/negative.d.ts +78 -0
- package/cjs/number/negative.d.ts.map +1 -0
- package/cjs/number/negative.js +3 -0
- package/cjs/number/negative.js.map +1 -0
- package/cjs/number/number_array.d.ts +3 -0
- package/cjs/number/number_array.d.ts.map +1 -0
- package/cjs/number/number_array.js +3 -0
- package/cjs/number/number_array.js.map +1 -0
- package/cjs/number/number_plus.d.ts +8 -0
- package/cjs/number/number_plus.d.ts.map +1 -0
- package/cjs/number/number_plus.js.map +1 -0
- package/cjs/number/number_type.d.ts +58 -0
- package/cjs/number/number_type.d.ts.map +1 -0
- package/cjs/number/number_type.js +3 -0
- package/cjs/number/number_type.js.map +1 -0
- package/cjs/number/numeric_type.d.ts +67 -0
- package/cjs/number/numeric_type.d.ts.map +1 -0
- package/cjs/number/numeric_type.js +3 -0
- package/cjs/number/numeric_type.js.map +1 -0
- package/cjs/number/positive.d.ts +61 -0
- package/cjs/number/positive.d.ts.map +1 -0
- package/cjs/number/positive.js +3 -0
- package/cjs/number/positive.js.map +1 -0
- package/cjs/number/strict_number_type.d.ts +61 -0
- package/cjs/number/strict_number_type.d.ts.map +1 -0
- package/cjs/number/strict_number_type.js +3 -0
- package/cjs/number/strict_number_type.js.map +1 -0
- package/cjs/object/ANotB.d.ts +1 -1
- package/cjs/object/ANotB.d.ts.map +1 -1
- package/cjs/object/KnownKeys.d.ts +1 -1
- package/cjs/object/KnownKeys.d.ts.map +1 -1
- package/cjs/object/Partial.d.ts +1 -1
- package/cjs/object/Partial.d.ts.map +1 -1
- package/cjs/object/getField.d.ts +1 -1
- package/cjs/object/getField.d.ts.map +1 -1
- package/cjs/object/hasProperty.d.ts +1 -1
- package/cjs/object/hasProperty.d.ts.map +1 -1
- package/cjs/object/index.d.ts +17 -16
- package/cjs/object/index.d.ts.map +1 -1
- package/cjs/object/index.js.map +1 -1
- package/cjs/object/object_type.d.ts +62 -0
- package/cjs/object/object_type.d.ts.map +1 -0
- package/cjs/object/object_type.js +3 -0
- package/cjs/object/object_type.js.map +1 -0
- package/cjs/object/omit.d.ts +1 -1
- package/cjs/object/omit.d.ts.map +1 -1
- package/cjs/object/pick.d.ts +1 -1
- package/cjs/object/pick.d.ts.map +1 -1
- package/cjs/object/properties.d.ts +7 -0
- package/cjs/object/properties.d.ts.map +1 -0
- package/cjs/object/properties.js +3 -0
- package/cjs/object/properties.js.map +1 -0
- package/cjs/predicates/index.d.ts +0 -2
- package/cjs/predicates/index.d.ts.map +1 -1
- package/cjs/predicates/index.js.map +1 -1
- package/cjs/predicates/isType.d.ts +1 -1
- package/cjs/predicates/isType.d.ts.map +1 -1
- package/cjs/predicates/isType.js +2 -1
- package/cjs/predicates/isType.js.map +1 -1
- package/cjs/primitive.d.ts +2 -0
- package/cjs/primitive.d.ts.map +1 -0
- package/cjs/primitive.js +3 -0
- package/cjs/primitive.js.map +1 -0
- package/cjs/string/strict_string_type.d.ts +66 -0
- package/cjs/string/strict_string_type.d.ts.map +1 -0
- package/cjs/string/strict_string_type.js +3 -0
- package/cjs/string/strict_string_type.js.map +1 -0
- package/cjs/string/string_type.d.ts +66 -0
- package/cjs/string/string_type.d.ts.map +1 -0
- package/cjs/string/string_type.js +3 -0
- package/cjs/string/string_type.js.map +1 -0
- package/cjs/symbol/symbol_type.d.ts +60 -0
- package/cjs/symbol/symbol_type.d.ts.map +1 -0
- package/cjs/symbol/symbol_type.js +3 -0
- package/cjs/symbol/symbol_type.js.map +1 -0
- package/cjs/testing/stub.d.ts +2 -2
- package/cjs/testing/stub.d.ts.map +1 -1
- package/cjs/testing/test_type.d.ts +102 -0
- package/cjs/testing/test_type.d.ts.map +1 -0
- package/cjs/testing/test_type.js +105 -0
- package/cjs/testing/test_type.js.map +1 -0
- package/cjs/tuple/tuple_type.d.ts +67 -0
- package/cjs/tuple/tuple_type.d.ts.map +1 -0
- package/cjs/tuple/tuple_type.js +3 -0
- package/cjs/tuple/tuple_type.js.map +1 -0
- package/cjs/type/constants.d.ts +5 -0
- package/cjs/type/constants.d.ts.map +1 -0
- package/cjs/type/constants.js +8 -0
- package/cjs/type/constants.js.map +1 -0
- package/cjs/type/failed.d.ts +33 -0
- package/cjs/type/failed.d.ts.map +1 -0
- package/cjs/type/failed.js +4 -0
- package/cjs/type/failed.js.map +1 -0
- package/cjs/undefined/undefined_type.d.ts +61 -0
- package/cjs/undefined/undefined_type.d.ts.map +1 -0
- package/cjs/undefined/undefined_type.js +3 -0
- package/cjs/undefined/undefined_type.js.map +1 -0
- package/cjs/union/union_to_intersection.d.ts +3 -0
- package/cjs/union/union_to_intersection.d.ts.map +1 -0
- package/cjs/union/union_to_intersection.js +8 -0
- package/cjs/union/union_to_intersection.js.map +1 -0
- package/cjs/union_keys.d.ts +6 -0
- package/cjs/union_keys.d.ts.map +1 -0
- package/cjs/union_keys.js +3 -0
- package/cjs/union_keys.js.map +1 -0
- package/cjs/unknown/unknown_type.d.ts +59 -0
- package/cjs/unknown/unknown_type.d.ts.map +1 -0
- package/cjs/unknown/unknown_type.js +3 -0
- package/cjs/unknown/unknown_type.js.map +1 -0
- package/cjs/void/void_type.d.ts +51 -0
- package/cjs/void/void_type.d.ts.map +1 -0
- package/cjs/void/void_type.js +3 -0
- package/cjs/void/void_type.js.map +1 -0
- package/esm/any/any_or_never.d.ts +17 -0
- package/esm/any/any_or_never.d.ts.map +1 -0
- package/esm/any/any_or_never.js +2 -0
- package/esm/any/any_or_never.js.map +1 -0
- package/esm/any/any_type.d.ts +57 -0
- package/esm/any/any_type.d.ts.map +1 -0
- package/esm/any/any_type.js +2 -0
- package/esm/any/any_type.js.map +1 -0
- package/esm/array/array.d.ts +32 -0
- package/esm/array/array.d.ts.map +1 -0
- package/esm/array/array.js.map +1 -0
- package/esm/array/array_index.d.ts +37 -0
- package/esm/array/array_index.d.ts.map +1 -0
- package/esm/array/array_index.js +2 -0
- package/esm/array/array_index.js.map +1 -0
- package/esm/array/array_plus.d.ts +3 -0
- package/esm/array/array_plus.d.ts.map +1 -0
- package/esm/array/array_plus.js.map +1 -0
- package/esm/array/array_type.d.ts +56 -0
- package/esm/array/array_type.d.ts.map +1 -0
- package/esm/array/array_type.js +2 -0
- package/esm/array/array_type.js.map +1 -0
- package/esm/array/common_prop_keys.d.ts.map +1 -0
- package/esm/array/common_prop_keys.js.map +1 -0
- package/esm/array/create_tuple.d.ts +11 -0
- package/esm/array/create_tuple.d.ts.map +1 -0
- package/esm/array/create_tuple.js.map +1 -0
- package/esm/array/drop.d.ts +19 -0
- package/esm/array/drop.d.ts.map +1 -0
- package/esm/array/drop.js.map +1 -0
- package/esm/array/filter.d.ts +9 -0
- package/esm/array/filter.d.ts.map +1 -0
- package/esm/array/filter.js.map +1 -0
- package/esm/array/find_first.d.ts.map +1 -0
- package/esm/array/find_first.js.map +1 -0
- package/esm/array/find_last.d.ts.map +1 -0
- package/esm/array/find_last.js.map +1 -0
- package/esm/array/head.d.ts.map +1 -0
- package/esm/array/head.js.map +1 -0
- package/esm/array/index.d.ts +18 -0
- package/esm/array/index.d.ts.map +1 -0
- package/esm/array/index.js +18 -0
- package/esm/array/index.js.map +1 -0
- package/esm/array/intersect_of_props.d.ts.map +1 -0
- package/esm/array/intersect_of_props.js.map +1 -0
- package/esm/array/last.d.ts.map +1 -0
- package/esm/array/last.js.map +1 -0
- package/esm/array/literal_array.d.ts.map +1 -0
- package/esm/array/literal_array.js.map +1 -0
- package/esm/array/pad_left.d.ts +6 -0
- package/esm/array/pad_left.d.ts.map +1 -0
- package/esm/array/pad_left.js.map +1 -0
- package/esm/array/reduce_while.d.ts.map +1 -0
- package/esm/array/reduce_while.js.map +1 -0
- package/esm/array/reverse.d.ts.map +1 -0
- package/esm/array/reverse.js.map +1 -0
- package/esm/array/some.d.ts +8 -0
- package/esm/array/some.d.ts.map +1 -0
- package/esm/array/some.js.map +1 -0
- package/esm/array/tail.d.ts.map +1 -0
- package/esm/array/tail.js.map +1 -0
- package/esm/array/union_of_props.d.ts.map +1 -0
- package/esm/array/union_of_props.js.map +1 -0
- package/esm/array/union_of_values.d.ts.map +1 -0
- package/esm/array/union_of_values.js.map +1 -0
- package/esm/assertion/assert_type.d.ts +34 -0
- package/esm/assertion/assert_type.d.ts.map +1 -0
- package/esm/assertion/assert_type.js +103 -0
- package/esm/assertion/assert_type.js.map +1 -0
- package/esm/bigint/bigint_type.d.ts +62 -0
- package/esm/bigint/bigint_type.d.ts.map +1 -0
- package/esm/bigint/bigint_type.js +2 -0
- package/esm/bigint/bigint_type.js.map +1 -0
- package/esm/bigint/strict_bigint_type.d.ts +64 -0
- package/esm/bigint/strict_bigint_type.d.ts.map +1 -0
- package/esm/bigint/strict_bigint_type.js +2 -0
- package/esm/bigint/strict_bigint_type.js.map +1 -0
- package/esm/boolean/boolean_type.d.ts +64 -0
- package/esm/boolean/boolean_type.d.ts.map +1 -0
- package/esm/boolean/boolean_type.js +2 -0
- package/esm/boolean/boolean_type.js.map +1 -0
- package/esm/boolean/false_type.d.ts +57 -0
- package/esm/boolean/false_type.d.ts.map +1 -0
- package/esm/boolean/false_type.js +2 -0
- package/esm/boolean/false_type.js.map +1 -0
- package/esm/boolean/strict_boolean_type.d.ts +61 -0
- package/esm/boolean/strict_boolean_type.d.ts.map +1 -0
- package/esm/boolean/strict_boolean_type.js +2 -0
- package/esm/boolean/strict_boolean_type.js.map +1 -0
- package/esm/boolean/true_type.d.ts +57 -0
- package/esm/boolean/true_type.d.ts.map +1 -0
- package/esm/boolean/true_type.js +2 -0
- package/esm/boolean/true_type.js.map +1 -0
- package/esm/composable_types.d.ts +9 -0
- package/esm/composable_types.d.ts.map +1 -0
- package/esm/composable_types.js +2 -0
- package/esm/composable_types.js.map +1 -0
- package/esm/equal/equal.d.ts +52 -0
- package/esm/equal/equal.d.ts.map +1 -0
- package/esm/equal/equal.js +2 -0
- package/esm/equal/equal.js.map +1 -0
- package/esm/function/any_function.d.ts +2 -0
- package/esm/function/any_function.d.ts.map +1 -0
- package/esm/function/any_function.js +2 -0
- package/esm/function/any_function.js.map +1 -0
- package/esm/function/extract_function.d.ts +24 -0
- package/esm/function/extract_function.d.ts.map +1 -0
- package/esm/function/extract_function.js +9 -0
- package/esm/function/extract_function.js.map +1 -0
- package/esm/function/function_type.d.ts +67 -0
- package/esm/function/function_type.d.ts.map +1 -0
- package/esm/function/function_type.js +2 -0
- package/esm/function/function_type.js.map +1 -0
- package/esm/function/strict_function_type.d.ts +57 -0
- package/esm/function/strict_function_type.d.ts.map +1 -0
- package/esm/function/strict_function_type.js +2 -0
- package/esm/function/strict_function_type.js.map +1 -0
- package/esm/functional/Maybe.d.ts +2 -2
- package/esm/functional/Maybe.d.ts.map +1 -1
- package/esm/functional/compose.d.ts +2 -2
- package/esm/functional/compose.d.ts.map +1 -1
- package/esm/index.d.ts +44 -15
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +8 -12
- package/esm/index.js.map +1 -1
- package/esm/json.d.ts +12 -0
- package/esm/json.d.ts.map +1 -0
- package/esm/json.js +11 -0
- package/esm/json.js.map +1 -0
- package/esm/math/Add.d.ts +4 -3
- package/esm/math/Add.d.ts.map +1 -1
- package/esm/math/Digit.d.ts +4 -3
- package/esm/math/Digit.d.ts.map +1 -1
- package/esm/math/GreaterThan.d.ts +6 -4
- package/esm/math/GreaterThan.d.ts.map +1 -1
- package/esm/math/Max.d.ts +1 -1
- package/esm/math/Max.d.ts.map +1 -1
- package/esm/math/Subtract.d.ts +4 -3
- package/esm/math/Subtract.d.ts.map +1 -1
- package/esm/never/never_type.d.ts +59 -0
- package/esm/never/never_type.d.ts.map +1 -0
- package/esm/never/never_type.js +2 -0
- package/esm/never/never_type.js.map +1 -0
- package/esm/nominal/brand.d.ts +23 -0
- package/esm/nominal/brand.d.ts.map +1 -0
- package/esm/nominal/brand.js +16 -0
- package/esm/nominal/brand.js.map +1 -0
- package/esm/nominal/constants.d.ts +3 -0
- package/esm/nominal/constants.d.ts.map +1 -0
- package/esm/nominal/constants.js +3 -0
- package/esm/nominal/constants.js.map +1 -0
- package/esm/nominal/flavor.d.ts +31 -0
- package/esm/nominal/flavor.d.ts.map +1 -0
- package/esm/nominal/flavor.js +16 -0
- package/esm/nominal/flavor.js.map +1 -0
- package/esm/nominal/index.d.ts +4 -0
- package/esm/nominal/index.d.ts.map +1 -0
- package/esm/nominal/index.js +4 -0
- package/esm/nominal/index.js.map +1 -0
- package/esm/nominal/nominal_match.d.ts +5 -0
- package/esm/nominal/nominal_match.d.ts.map +1 -0
- package/esm/nominal/nominal_match.js +9 -0
- package/esm/nominal/nominal_match.js.map +1 -0
- package/esm/null/null_type.d.ts +58 -0
- package/esm/null/null_type.d.ts.map +1 -0
- package/esm/null/null_type.js +2 -0
- package/esm/null/null_type.js.map +1 -0
- package/esm/number/integer.d.ts +75 -0
- package/esm/number/integer.d.ts.map +1 -0
- package/esm/number/integer.js +2 -0
- package/esm/number/integer.js.map +1 -0
- package/esm/number/negative.d.ts +78 -0
- package/esm/number/negative.d.ts.map +1 -0
- package/esm/number/negative.js +2 -0
- package/esm/number/negative.js.map +1 -0
- package/esm/number/number_array.d.ts +3 -0
- package/esm/number/number_array.d.ts.map +1 -0
- package/esm/number/number_array.js +2 -0
- package/esm/number/number_array.js.map +1 -0
- package/esm/number/number_plus.d.ts +8 -0
- package/esm/number/number_plus.d.ts.map +1 -0
- package/esm/number/number_plus.js.map +1 -0
- package/esm/number/number_type.d.ts +58 -0
- package/esm/number/number_type.d.ts.map +1 -0
- package/esm/number/number_type.js +2 -0
- package/esm/number/number_type.js.map +1 -0
- package/esm/number/numeric_type.d.ts +67 -0
- package/esm/number/numeric_type.d.ts.map +1 -0
- package/esm/number/numeric_type.js +2 -0
- package/esm/number/numeric_type.js.map +1 -0
- package/esm/number/positive.d.ts +61 -0
- package/esm/number/positive.d.ts.map +1 -0
- package/esm/number/positive.js +2 -0
- package/esm/number/positive.js.map +1 -0
- package/esm/number/strict_number_type.d.ts +61 -0
- package/esm/number/strict_number_type.d.ts.map +1 -0
- package/esm/number/strict_number_type.js +2 -0
- package/esm/number/strict_number_type.js.map +1 -0
- package/esm/object/ANotB.d.ts +1 -1
- package/esm/object/ANotB.d.ts.map +1 -1
- package/esm/object/KnownKeys.d.ts +1 -1
- package/esm/object/KnownKeys.d.ts.map +1 -1
- package/esm/object/Partial.d.ts +1 -1
- package/esm/object/Partial.d.ts.map +1 -1
- package/esm/object/getField.d.ts +1 -1
- package/esm/object/getField.d.ts.map +1 -1
- package/esm/object/hasProperty.d.ts +1 -1
- package/esm/object/hasProperty.d.ts.map +1 -1
- package/esm/object/index.d.ts +17 -16
- package/esm/object/index.d.ts.map +1 -1
- package/esm/object/index.js.map +1 -1
- package/esm/object/object_type.d.ts +62 -0
- package/esm/object/object_type.d.ts.map +1 -0
- package/esm/object/object_type.js +2 -0
- package/esm/object/object_type.js.map +1 -0
- package/esm/object/omit.d.ts +1 -1
- package/esm/object/omit.d.ts.map +1 -1
- package/esm/object/pick.d.ts +1 -1
- package/esm/object/pick.d.ts.map +1 -1
- package/esm/object/properties.d.ts +7 -0
- package/esm/object/properties.d.ts.map +1 -0
- package/esm/object/properties.js +2 -0
- package/esm/object/properties.js.map +1 -0
- package/esm/predicates/index.d.ts +0 -2
- package/esm/predicates/index.d.ts.map +1 -1
- package/esm/predicates/index.js.map +1 -1
- package/esm/predicates/isType.d.ts +1 -1
- package/esm/predicates/isType.d.ts.map +1 -1
- package/esm/predicates/isType.js +2 -1
- package/esm/predicates/isType.js.map +1 -1
- package/esm/primitive.d.ts +2 -0
- package/esm/primitive.d.ts.map +1 -0
- package/esm/primitive.js +2 -0
- package/esm/primitive.js.map +1 -0
- package/esm/string/strict_string_type.d.ts +66 -0
- package/esm/string/strict_string_type.d.ts.map +1 -0
- package/esm/string/strict_string_type.js +2 -0
- package/esm/string/strict_string_type.js.map +1 -0
- package/esm/string/string_type.d.ts +66 -0
- package/esm/string/string_type.d.ts.map +1 -0
- package/esm/string/string_type.js +2 -0
- package/esm/string/string_type.js.map +1 -0
- package/esm/symbol/symbol_type.d.ts +60 -0
- package/esm/symbol/symbol_type.d.ts.map +1 -0
- package/esm/symbol/symbol_type.js +2 -0
- package/esm/symbol/symbol_type.js.map +1 -0
- package/esm/testing/stub.d.ts +2 -2
- package/esm/testing/stub.d.ts.map +1 -1
- package/esm/testing/test_type.d.ts +102 -0
- package/esm/testing/test_type.d.ts.map +1 -0
- package/esm/testing/test_type.js +102 -0
- package/esm/testing/test_type.js.map +1 -0
- package/esm/tuple/tuple_type.d.ts +67 -0
- package/esm/tuple/tuple_type.d.ts.map +1 -0
- package/esm/tuple/tuple_type.js +2 -0
- package/esm/tuple/tuple_type.js.map +1 -0
- package/esm/type/constants.d.ts +5 -0
- package/esm/type/constants.d.ts.map +1 -0
- package/esm/type/constants.js +5 -0
- package/esm/type/constants.js.map +1 -0
- package/esm/type/failed.d.ts +33 -0
- package/esm/type/failed.d.ts.map +1 -0
- package/esm/type/failed.js +2 -0
- package/esm/type/failed.js.map +1 -0
- package/esm/undefined/undefined_type.d.ts +61 -0
- package/esm/undefined/undefined_type.d.ts.map +1 -0
- package/esm/undefined/undefined_type.js +2 -0
- package/esm/undefined/undefined_type.js.map +1 -0
- package/esm/union/union_to_intersection.d.ts +3 -0
- package/esm/union/union_to_intersection.d.ts.map +1 -0
- package/esm/union/union_to_intersection.js +4 -0
- package/esm/union/union_to_intersection.js.map +1 -0
- package/esm/union_keys.d.ts +6 -0
- package/esm/union_keys.d.ts.map +1 -0
- package/esm/union_keys.js +2 -0
- package/esm/union_keys.js.map +1 -0
- package/esm/unknown/unknown_type.d.ts +59 -0
- package/esm/unknown/unknown_type.d.ts.map +1 -0
- package/esm/unknown/unknown_type.js +2 -0
- package/esm/unknown/unknown_type.js.map +1 -0
- package/esm/void/void_type.d.ts +51 -0
- package/esm/void/void_type.d.ts.map +1 -0
- package/esm/void/void_type.js +2 -0
- package/esm/void/void_type.js.map +1 -0
- package/package.json +10 -28
- package/ts/any/any_or_never.ts +17 -0
- package/ts/any/any_type.ts +60 -0
- package/ts/any/readme.md +26 -0
- package/ts/array/array.ts +37 -0
- package/ts/array/array_index.ts +70 -0
- package/ts/array/array_plus.ts +2 -0
- package/ts/array/array_type.ts +61 -0
- package/ts/array/create_tuple.ts +17 -0
- package/ts/array/drop.ts +71 -0
- package/ts/array/filter.ts +27 -0
- package/ts/array/index.ts +17 -0
- package/ts/array/pad_left.ts +16 -0
- package/ts/array/readme.md +32 -0
- package/ts/array/some.ts +33 -0
- package/ts/assertion/assert_type.ts +107 -0
- package/ts/assertion/readme.md +14 -0
- package/ts/bigint/bigint_type.ts +65 -0
- package/ts/bigint/readme.md +51 -0
- package/ts/bigint/strict_bigint_type.ts +69 -0
- package/ts/boolean/boolean_type.ts +69 -0
- package/ts/boolean/false_type.ts +61 -0
- package/ts/boolean/readme.md +85 -0
- package/ts/boolean/strict_boolean_type.ts +65 -0
- package/ts/boolean/true_type.ts +61 -0
- package/ts/composable_types.ts +9 -0
- package/ts/equal/equal.ts +88 -0
- package/ts/equal/readme.md +31 -0
- package/ts/function/extract_function.ts +29 -0
- package/ts/function/function_type.ts +72 -0
- package/ts/function/readme.md +84 -0
- package/ts/function/strict_function_type.ts +61 -0
- package/ts/functional/Maybe.ts +2 -2
- package/ts/functional/compose.ts +2 -2
- package/ts/index.ts +92 -19
- package/ts/math/Add.ts +5 -4
- package/ts/math/Digit.ts +4 -3
- package/ts/math/GreaterThan.ts +7 -5
- package/ts/math/Max.ts +1 -1
- package/ts/math/Subtract.ts +5 -5
- package/ts/never/never_type.ts +65 -0
- package/ts/never/readme.md +37 -0
- package/ts/nominal/brand.ts +43 -0
- package/ts/nominal/flavor.ts +53 -0
- package/ts/nominal/index.ts +3 -0
- package/ts/nominal/nominal_match.ts +22 -0
- package/ts/null/null_type.ts +61 -0
- package/ts/null/readme.md +24 -0
- package/ts/number/integer.ts +81 -0
- package/ts/number/negative.ts +109 -0
- package/ts/number/number_array.ts +15 -0
- package/ts/number/number_plus.ts +20 -0
- package/ts/number/number_type.ts +61 -0
- package/ts/number/numeric_type.ts +72 -0
- package/ts/number/positive.ts +68 -0
- package/ts/number/readme.md +155 -0
- package/ts/number/strict_number_type.ts +65 -0
- package/ts/object/ANotB.ts +1 -1
- package/ts/object/KnownKeys.ts +1 -1
- package/ts/object/Partial.ts +1 -1
- package/ts/object/getField.ts +1 -1
- package/ts/object/hasProperty.ts +1 -1
- package/ts/object/index.ts +17 -16
- package/ts/object/object_type.ts +65 -0
- package/ts/object/omit.ts +1 -1
- package/ts/object/pick.ts +1 -1
- package/ts/object/properties.ts +4 -0
- package/ts/object/readme.md +28 -0
- package/ts/predicates/index.ts +0 -3
- package/ts/predicates/isType.ts +4 -2
- package/ts/primitive.ts +10 -0
- package/ts/string/readme.md +43 -0
- package/ts/string/strict_string_type.ts +69 -0
- package/ts/string/string_type.ts +69 -0
- package/ts/symbol/readme.md +34 -0
- package/ts/symbol/symbol_type.ts +65 -0
- package/ts/testing/readme.md +19 -0
- package/ts/testing/stub.ts +2 -2
- package/ts/testing/test_type.ts +127 -0
- package/ts/tuple/readme.md +24 -4
- package/ts/tuple/tuple_type.ts +72 -0
- package/ts/type/constants.ts +4 -0
- package/ts/type/failed.ts +34 -0
- package/ts/undefined/readme.md +18 -0
- package/ts/undefined/undefined_type.ts +65 -0
- package/ts/unknown/readme.md +27 -0
- package/ts/unknown/unknown_type.ts +63 -0
- package/ts/void/readme.md +26 -0
- package/ts/void/void_type.ts +58 -0
- package/cjs/ComposableTypes.d.ts +0 -9
- package/cjs/ComposableTypes.d.ts.map +0 -1
- package/cjs/ComposableTypes.js +0 -3
- package/cjs/ComposableTypes.js.map +0 -1
- package/cjs/JSONTypes.d.ts +0 -12
- package/cjs/JSONTypes.d.ts.map +0 -1
- package/cjs/JSONTypes.js +0 -14
- package/cjs/JSONTypes.js.map +0 -1
- package/cjs/PrimitiveTypes.d.ts +0 -3
- package/cjs/PrimitiveTypes.d.ts.map +0 -1
- package/cjs/PrimitiveTypes.js +0 -4
- package/cjs/PrimitiveTypes.js.map +0 -1
- package/cjs/UnionKeys.d.ts +0 -6
- package/cjs/UnionKeys.d.ts.map +0 -1
- package/cjs/UnionKeys.js +0 -3
- package/cjs/UnionKeys.js.map +0 -1
- package/cjs/UnionToIntersection.d.ts +0 -3
- package/cjs/UnionToIntersection.d.ts.map +0 -1
- package/cjs/UnionToIntersection.js +0 -8
- package/cjs/UnionToIntersection.js.map +0 -1
- package/cjs/any_plus/any.d.ts +0 -29
- package/cjs/any_plus/any.d.ts.map +0 -1
- package/cjs/any_plus/any.js +0 -3
- package/cjs/any_plus/any.js.map +0 -1
- package/cjs/any_plus/index.d.ts +0 -2
- package/cjs/any_plus/index.d.ts.map +0 -1
- package/cjs/any_plus/index.js +0 -3
- package/cjs/any_plus/index.js.map +0 -1
- package/cjs/array_plus/array.d.ts +0 -42
- package/cjs/array_plus/array.d.ts.map +0 -1
- package/cjs/array_plus/array.js.map +0 -1
- package/cjs/array_plus/array_number.d.ts +0 -4
- package/cjs/array_plus/array_number.d.ts.map +0 -1
- package/cjs/array_plus/array_number.js +0 -3
- package/cjs/array_plus/array_number.js.map +0 -1
- package/cjs/array_plus/array_plus.d.ts +0 -35
- package/cjs/array_plus/array_plus.d.ts.map +0 -1
- package/cjs/array_plus/array_plus.js.map +0 -1
- package/cjs/array_plus/common_prop_keys.d.ts.map +0 -1
- package/cjs/array_plus/common_prop_keys.js.map +0 -1
- package/cjs/array_plus/create_tuple.d.ts +0 -10
- package/cjs/array_plus/create_tuple.d.ts.map +0 -1
- package/cjs/array_plus/create_tuple.js.map +0 -1
- package/cjs/array_plus/drop.d.ts +0 -19
- package/cjs/array_plus/drop.d.ts.map +0 -1
- package/cjs/array_plus/drop.js.map +0 -1
- package/cjs/array_plus/filter.d.ts +0 -10
- package/cjs/array_plus/filter.d.ts.map +0 -1
- package/cjs/array_plus/filter.js.map +0 -1
- package/cjs/array_plus/find_first.d.ts.map +0 -1
- package/cjs/array_plus/find_first.js.map +0 -1
- package/cjs/array_plus/find_last.d.ts.map +0 -1
- package/cjs/array_plus/find_last.js.map +0 -1
- package/cjs/array_plus/head.d.ts.map +0 -1
- package/cjs/array_plus/head.js.map +0 -1
- package/cjs/array_plus/index.d.ts +0 -20
- package/cjs/array_plus/index.d.ts.map +0 -1
- package/cjs/array_plus/index.js +0 -20
- package/cjs/array_plus/index.js.map +0 -1
- package/cjs/array_plus/intersect_of_props.d.ts.map +0 -1
- package/cjs/array_plus/intersect_of_props.js.map +0 -1
- package/cjs/array_plus/is_array.d.ts +0 -2
- package/cjs/array_plus/is_array.d.ts.map +0 -1
- package/cjs/array_plus/is_array.js +0 -3
- package/cjs/array_plus/is_array.js.map +0 -1
- package/cjs/array_plus/last.d.ts.map +0 -1
- package/cjs/array_plus/last.js.map +0 -1
- package/cjs/array_plus/literal_array.d.ts.map +0 -1
- package/cjs/array_plus/literal_array.js.map +0 -1
- package/cjs/array_plus/pad_left.d.ts +0 -6
- package/cjs/array_plus/pad_left.d.ts.map +0 -1
- package/cjs/array_plus/pad_left.js.map +0 -1
- package/cjs/array_plus/reduce_while.d.ts.map +0 -1
- package/cjs/array_plus/reduce_while.js.map +0 -1
- package/cjs/array_plus/reverse.d.ts.map +0 -1
- package/cjs/array_plus/reverse.js.map +0 -1
- package/cjs/array_plus/some.d.ts +0 -8
- package/cjs/array_plus/some.d.ts.map +0 -1
- package/cjs/array_plus/some.js.map +0 -1
- package/cjs/array_plus/tail.d.ts.map +0 -1
- package/cjs/array_plus/tail.js.map +0 -1
- package/cjs/array_plus/union_of_props.d.ts.map +0 -1
- package/cjs/array_plus/union_of_props.js.map +0 -1
- package/cjs/array_plus/union_of_values.d.ts.map +0 -1
- package/cjs/array_plus/union_of_values.js.map +0 -1
- package/cjs/assertion/assertType.d.ts +0 -34
- package/cjs/assertion/assertType.d.ts.map +0 -1
- package/cjs/assertion/assertType.js +0 -107
- package/cjs/assertion/assertType.js.map +0 -1
- package/cjs/assertion/index.d.ts +0 -2
- package/cjs/assertion/index.d.ts.map +0 -1
- package/cjs/assertion/index.js +0 -18
- package/cjs/assertion/index.js.map +0 -1
- package/cjs/function/AnyFunction.d.ts +0 -2
- package/cjs/function/AnyFunction.d.ts.map +0 -1
- package/cjs/function/AnyFunction.js +0 -3
- package/cjs/function/AnyFunction.js.map +0 -1
- package/cjs/function/ExtractFunction.d.ts +0 -15
- package/cjs/function/ExtractFunction.d.ts.map +0 -1
- package/cjs/function/ExtractFunction.js +0 -13
- package/cjs/function/ExtractFunction.js.map +0 -1
- package/cjs/function/index.d.ts +0 -3
- package/cjs/function/index.d.ts.map +0 -1
- package/cjs/function/index.js +0 -18
- package/cjs/function/index.js.map +0 -1
- package/cjs/nominal-types/Brand.d.ts +0 -21
- package/cjs/nominal-types/Brand.d.ts.map +0 -1
- package/cjs/nominal-types/Brand.js +0 -20
- package/cjs/nominal-types/Brand.js.map +0 -1
- package/cjs/nominal-types/Flavor.d.ts +0 -20
- package/cjs/nominal-types/Flavor.d.ts.map +0 -1
- package/cjs/nominal-types/Flavor.js +0 -20
- package/cjs/nominal-types/Flavor.js.map +0 -1
- package/cjs/nominal-types/index.d.ts +0 -4
- package/cjs/nominal-types/index.d.ts.map +0 -1
- package/cjs/nominal-types/index.js +0 -20
- package/cjs/nominal-types/index.js.map +0 -1
- package/cjs/nominal-types/nominalMatch.d.ts +0 -5
- package/cjs/nominal-types/nominalMatch.d.ts.map +0 -1
- package/cjs/nominal-types/nominalMatch.js +0 -13
- package/cjs/nominal-types/nominalMatch.js.map +0 -1
- package/cjs/nominal-types/types.d.ts +0 -3
- package/cjs/nominal-types/types.d.ts.map +0 -1
- package/cjs/nominal-types/types.js +0 -6
- package/cjs/nominal-types/types.js.map +0 -1
- package/cjs/number_plus/index.d.ts +0 -2
- package/cjs/number_plus/index.d.ts.map +0 -1
- package/cjs/number_plus/index.js +0 -3
- package/cjs/number_plus/index.js.map +0 -1
- package/cjs/number_plus/number.d.ts +0 -128
- package/cjs/number_plus/number.d.ts.map +0 -1
- package/cjs/number_plus/number.js +0 -3
- package/cjs/number_plus/number.js.map +0 -1
- package/cjs/number_plus/number_plus.d.ts +0 -2
- package/cjs/number_plus/number_plus.d.ts.map +0 -1
- package/cjs/number_plus/number_plus.js.map +0 -1
- package/cjs/predicates/Equal.d.ts +0 -38
- package/cjs/predicates/Equal.d.ts.map +0 -1
- package/cjs/predicates/Equal.js +0 -3
- package/cjs/predicates/Equal.js.map +0 -1
- package/cjs/testing/index.d.ts +0 -2
- package/cjs/testing/index.d.ts.map +0 -1
- package/cjs/testing/index.js +0 -18
- package/cjs/testing/index.js.map +0 -1
- package/cjs/tuple/index.d.ts +0 -2
- package/cjs/tuple/index.d.ts.map +0 -1
- package/cjs/tuple/index.js +0 -3
- package/cjs/tuple/index.js.map +0 -1
- package/cjs/tuple/tuple.d.ts +0 -16
- package/cjs/tuple/tuple.d.ts.map +0 -1
- package/cjs/tuple/tuple.js +0 -3
- package/cjs/tuple/tuple.js.map +0 -1
- package/esm/ComposableTypes.d.ts +0 -9
- package/esm/ComposableTypes.d.ts.map +0 -1
- package/esm/ComposableTypes.js +0 -2
- package/esm/ComposableTypes.js.map +0 -1
- package/esm/JSONTypes.d.ts +0 -12
- package/esm/JSONTypes.d.ts.map +0 -1
- package/esm/JSONTypes.js +0 -11
- package/esm/JSONTypes.js.map +0 -1
- package/esm/PrimitiveTypes.d.ts +0 -3
- package/esm/PrimitiveTypes.d.ts.map +0 -1
- package/esm/PrimitiveTypes.js +0 -3
- package/esm/PrimitiveTypes.js.map +0 -1
- package/esm/UnionKeys.d.ts +0 -6
- package/esm/UnionKeys.d.ts.map +0 -1
- package/esm/UnionKeys.js +0 -2
- package/esm/UnionKeys.js.map +0 -1
- package/esm/UnionToIntersection.d.ts +0 -3
- package/esm/UnionToIntersection.d.ts.map +0 -1
- package/esm/UnionToIntersection.js +0 -4
- package/esm/UnionToIntersection.js.map +0 -1
- package/esm/any_plus/any.d.ts +0 -29
- package/esm/any_plus/any.d.ts.map +0 -1
- package/esm/any_plus/any.js +0 -2
- package/esm/any_plus/any.js.map +0 -1
- package/esm/any_plus/index.d.ts +0 -2
- package/esm/any_plus/index.d.ts.map +0 -1
- package/esm/any_plus/index.js +0 -2
- package/esm/any_plus/index.js.map +0 -1
- package/esm/array_plus/array.d.ts +0 -42
- package/esm/array_plus/array.d.ts.map +0 -1
- package/esm/array_plus/array.js.map +0 -1
- package/esm/array_plus/array_number.d.ts +0 -4
- package/esm/array_plus/array_number.d.ts.map +0 -1
- package/esm/array_plus/array_number.js +0 -2
- package/esm/array_plus/array_number.js.map +0 -1
- package/esm/array_plus/array_plus.d.ts +0 -35
- package/esm/array_plus/array_plus.d.ts.map +0 -1
- package/esm/array_plus/array_plus.js.map +0 -1
- package/esm/array_plus/common_prop_keys.d.ts.map +0 -1
- package/esm/array_plus/common_prop_keys.js.map +0 -1
- package/esm/array_plus/create_tuple.d.ts +0 -10
- package/esm/array_plus/create_tuple.d.ts.map +0 -1
- package/esm/array_plus/create_tuple.js.map +0 -1
- package/esm/array_plus/drop.d.ts +0 -19
- package/esm/array_plus/drop.d.ts.map +0 -1
- package/esm/array_plus/drop.js.map +0 -1
- package/esm/array_plus/filter.d.ts +0 -10
- package/esm/array_plus/filter.d.ts.map +0 -1
- package/esm/array_plus/filter.js.map +0 -1
- package/esm/array_plus/find_first.d.ts.map +0 -1
- package/esm/array_plus/find_first.js.map +0 -1
- package/esm/array_plus/find_last.d.ts.map +0 -1
- package/esm/array_plus/find_last.js.map +0 -1
- package/esm/array_plus/head.d.ts.map +0 -1
- package/esm/array_plus/head.js.map +0 -1
- package/esm/array_plus/index.d.ts +0 -20
- package/esm/array_plus/index.d.ts.map +0 -1
- package/esm/array_plus/index.js +0 -4
- package/esm/array_plus/index.js.map +0 -1
- package/esm/array_plus/intersect_of_props.d.ts.map +0 -1
- package/esm/array_plus/intersect_of_props.js.map +0 -1
- package/esm/array_plus/is_array.d.ts +0 -2
- package/esm/array_plus/is_array.d.ts.map +0 -1
- package/esm/array_plus/is_array.js +0 -2
- package/esm/array_plus/is_array.js.map +0 -1
- package/esm/array_plus/last.d.ts.map +0 -1
- package/esm/array_plus/last.js.map +0 -1
- package/esm/array_plus/literal_array.d.ts.map +0 -1
- package/esm/array_plus/literal_array.js.map +0 -1
- package/esm/array_plus/pad_left.d.ts +0 -6
- package/esm/array_plus/pad_left.d.ts.map +0 -1
- package/esm/array_plus/pad_left.js.map +0 -1
- package/esm/array_plus/reduce_while.d.ts.map +0 -1
- package/esm/array_plus/reduce_while.js.map +0 -1
- package/esm/array_plus/reverse.d.ts.map +0 -1
- package/esm/array_plus/reverse.js.map +0 -1
- package/esm/array_plus/some.d.ts +0 -8
- package/esm/array_plus/some.d.ts.map +0 -1
- package/esm/array_plus/some.js.map +0 -1
- package/esm/array_plus/tail.d.ts.map +0 -1
- package/esm/array_plus/tail.js.map +0 -1
- package/esm/array_plus/union_of_props.d.ts.map +0 -1
- package/esm/array_plus/union_of_props.js.map +0 -1
- package/esm/array_plus/union_of_values.d.ts.map +0 -1
- package/esm/array_plus/union_of_values.js.map +0 -1
- package/esm/assertion/assertType.d.ts +0 -34
- package/esm/assertion/assertType.d.ts.map +0 -1
- package/esm/assertion/assertType.js +0 -103
- package/esm/assertion/assertType.js.map +0 -1
- package/esm/assertion/index.d.ts +0 -2
- package/esm/assertion/index.d.ts.map +0 -1
- package/esm/assertion/index.js +0 -2
- package/esm/assertion/index.js.map +0 -1
- package/esm/function/AnyFunction.d.ts +0 -2
- package/esm/function/AnyFunction.d.ts.map +0 -1
- package/esm/function/AnyFunction.js +0 -2
- package/esm/function/AnyFunction.js.map +0 -1
- package/esm/function/ExtractFunction.d.ts +0 -15
- package/esm/function/ExtractFunction.d.ts.map +0 -1
- package/esm/function/ExtractFunction.js +0 -9
- package/esm/function/ExtractFunction.js.map +0 -1
- package/esm/function/index.d.ts +0 -3
- package/esm/function/index.d.ts.map +0 -1
- package/esm/function/index.js +0 -2
- package/esm/function/index.js.map +0 -1
- package/esm/nominal-types/Brand.d.ts +0 -21
- package/esm/nominal-types/Brand.d.ts.map +0 -1
- package/esm/nominal-types/Brand.js +0 -16
- package/esm/nominal-types/Brand.js.map +0 -1
- package/esm/nominal-types/Flavor.d.ts +0 -20
- package/esm/nominal-types/Flavor.d.ts.map +0 -1
- package/esm/nominal-types/Flavor.js +0 -16
- package/esm/nominal-types/Flavor.js.map +0 -1
- package/esm/nominal-types/index.d.ts +0 -4
- package/esm/nominal-types/index.d.ts.map +0 -1
- package/esm/nominal-types/index.js +0 -4
- package/esm/nominal-types/index.js.map +0 -1
- package/esm/nominal-types/nominalMatch.d.ts +0 -5
- package/esm/nominal-types/nominalMatch.d.ts.map +0 -1
- package/esm/nominal-types/nominalMatch.js +0 -9
- package/esm/nominal-types/nominalMatch.js.map +0 -1
- package/esm/nominal-types/types.d.ts +0 -3
- package/esm/nominal-types/types.d.ts.map +0 -1
- package/esm/nominal-types/types.js +0 -3
- package/esm/nominal-types/types.js.map +0 -1
- package/esm/number_plus/index.d.ts +0 -2
- package/esm/number_plus/index.d.ts.map +0 -1
- package/esm/number_plus/index.js +0 -2
- package/esm/number_plus/index.js.map +0 -1
- package/esm/number_plus/number.d.ts +0 -128
- package/esm/number_plus/number.d.ts.map +0 -1
- package/esm/number_plus/number.js +0 -2
- package/esm/number_plus/number.js.map +0 -1
- package/esm/number_plus/number_plus.d.ts +0 -2
- package/esm/number_plus/number_plus.d.ts.map +0 -1
- package/esm/number_plus/number_plus.js.map +0 -1
- package/esm/predicates/Equal.d.ts +0 -38
- package/esm/predicates/Equal.d.ts.map +0 -1
- package/esm/predicates/Equal.js +0 -2
- package/esm/predicates/Equal.js.map +0 -1
- package/esm/testing/index.d.ts +0 -2
- package/esm/testing/index.d.ts.map +0 -1
- package/esm/testing/index.js +0 -2
- package/esm/testing/index.js.map +0 -1
- package/esm/tuple/index.d.ts +0 -2
- package/esm/tuple/index.d.ts.map +0 -1
- package/esm/tuple/index.js +0 -2
- package/esm/tuple/index.js.map +0 -1
- package/esm/tuple/tuple.d.ts +0 -16
- package/esm/tuple/tuple.d.ts.map +0 -1
- package/esm/tuple/tuple.js +0 -2
- package/esm/tuple/tuple.js.map +0 -1
- package/ts/ComposableTypes.ts +0 -10
- package/ts/PrimitiveTypes.ts +0 -15
- package/ts/any_plus/any.ts +0 -29
- package/ts/any_plus/index.ts +0 -1
- package/ts/array_plus/array.ts +0 -48
- package/ts/array_plus/array_number.ts +0 -12
- package/ts/array_plus/array_plus.ts +0 -66
- package/ts/array_plus/create_tuple.ts +0 -16
- package/ts/array_plus/drop.ts +0 -71
- package/ts/array_plus/filter.ts +0 -28
- package/ts/array_plus/index.ts +0 -19
- package/ts/array_plus/is_array.ts +0 -1
- package/ts/array_plus/pad_left.ts +0 -16
- package/ts/array_plus/some.ts +0 -33
- package/ts/assertion/assertType.ts +0 -107
- package/ts/assertion/index.ts +0 -1
- package/ts/function/ExtractFunction.ts +0 -20
- package/ts/function/index.ts +0 -2
- package/ts/nominal-types/Brand.ts +0 -34
- package/ts/nominal-types/Flavor.ts +0 -35
- package/ts/nominal-types/index.ts +0 -3
- package/ts/nominal-types/nominalMatch.ts +0 -22
- package/ts/number_plus/index.ts +0 -1
- package/ts/number_plus/number.ts +0 -149
- package/ts/number_plus/number_plus.ts +0 -1
- package/ts/predicates/Equal.ts +0 -43
- package/ts/testing/index.ts +0 -1
- package/ts/tuple/index.ts +0 -1
- package/ts/tuple/tuple.ts +0 -20
- /package/cjs/{array_plus → array}/array.js +0 -0
- /package/cjs/{array_plus → array}/array_plus.js +0 -0
- /package/cjs/{array_plus → array}/common_prop_keys.d.ts +0 -0
- /package/cjs/{array_plus → array}/common_prop_keys.js +0 -0
- /package/cjs/{array_plus → array}/create_tuple.js +0 -0
- /package/cjs/{array_plus → array}/drop.js +0 -0
- /package/cjs/{array_plus → array}/filter.js +0 -0
- /package/cjs/{array_plus → array}/find_first.d.ts +0 -0
- /package/cjs/{array_plus → array}/find_first.js +0 -0
- /package/cjs/{array_plus → array}/find_last.d.ts +0 -0
- /package/cjs/{array_plus → array}/find_last.js +0 -0
- /package/cjs/{array_plus → array}/head.d.ts +0 -0
- /package/cjs/{array_plus → array}/head.js +0 -0
- /package/cjs/{array_plus → array}/intersect_of_props.d.ts +0 -0
- /package/cjs/{array_plus → array}/intersect_of_props.js +0 -0
- /package/cjs/{array_plus → array}/last.d.ts +0 -0
- /package/cjs/{array_plus → array}/last.js +0 -0
- /package/cjs/{array_plus → array}/literal_array.d.ts +0 -0
- /package/cjs/{array_plus → array}/literal_array.js +0 -0
- /package/cjs/{array_plus → array}/pad_left.js +0 -0
- /package/cjs/{array_plus → array}/reduce_while.d.ts +0 -0
- /package/cjs/{array_plus → array}/reduce_while.js +0 -0
- /package/cjs/{array_plus → array}/reverse.d.ts +0 -0
- /package/cjs/{array_plus → array}/reverse.js +0 -0
- /package/cjs/{array_plus → array}/some.js +0 -0
- /package/cjs/{array_plus → array}/tail.d.ts +0 -0
- /package/cjs/{array_plus → array}/tail.js +0 -0
- /package/cjs/{array_plus → array}/union_of_props.d.ts +0 -0
- /package/cjs/{array_plus → array}/union_of_props.js +0 -0
- /package/cjs/{array_plus → array}/union_of_values.d.ts +0 -0
- /package/cjs/{array_plus → array}/union_of_values.js +0 -0
- /package/cjs/{number_plus → number}/number_plus.js +0 -0
- /package/esm/{array_plus → array}/array.js +0 -0
- /package/esm/{array_plus → array}/array_plus.js +0 -0
- /package/esm/{array_plus → array}/common_prop_keys.d.ts +0 -0
- /package/esm/{array_plus → array}/common_prop_keys.js +0 -0
- /package/esm/{array_plus → array}/create_tuple.js +0 -0
- /package/esm/{array_plus → array}/drop.js +0 -0
- /package/esm/{array_plus → array}/filter.js +0 -0
- /package/esm/{array_plus → array}/find_first.d.ts +0 -0
- /package/esm/{array_plus → array}/find_first.js +0 -0
- /package/esm/{array_plus → array}/find_last.d.ts +0 -0
- /package/esm/{array_plus → array}/find_last.js +0 -0
- /package/esm/{array_plus → array}/head.d.ts +0 -0
- /package/esm/{array_plus → array}/head.js +0 -0
- /package/esm/{array_plus → array}/intersect_of_props.d.ts +0 -0
- /package/esm/{array_plus → array}/intersect_of_props.js +0 -0
- /package/esm/{array_plus → array}/last.d.ts +0 -0
- /package/esm/{array_plus → array}/last.js +0 -0
- /package/esm/{array_plus → array}/literal_array.d.ts +0 -0
- /package/esm/{array_plus → array}/literal_array.js +0 -0
- /package/esm/{array_plus → array}/pad_left.js +0 -0
- /package/esm/{array_plus → array}/reduce_while.d.ts +0 -0
- /package/esm/{array_plus → array}/reduce_while.js +0 -0
- /package/esm/{array_plus → array}/reverse.d.ts +0 -0
- /package/esm/{array_plus → array}/reverse.js +0 -0
- /package/esm/{array_plus → array}/some.js +0 -0
- /package/esm/{array_plus → array}/tail.d.ts +0 -0
- /package/esm/{array_plus → array}/tail.js +0 -0
- /package/esm/{array_plus → array}/union_of_props.d.ts +0 -0
- /package/esm/{array_plus → array}/union_of_props.js +0 -0
- /package/esm/{array_plus → array}/union_of_values.d.ts +0 -0
- /package/esm/{array_plus → array}/union_of_values.js +0 -0
- /package/esm/{number_plus → number}/number_plus.js +0 -0
- /package/ts/{array_plus → array}/common_prop_keys.ts +0 -0
- /package/ts/{array_plus → array}/find_first.ts +0 -0
- /package/ts/{array_plus → array}/find_last.ts +0 -0
- /package/ts/{array_plus → array}/head.ts +0 -0
- /package/ts/{array_plus → array}/intersect_of_props.ts +0 -0
- /package/ts/{array_plus → array}/last.ts +0 -0
- /package/ts/{array_plus → array}/literal_array.ts +0 -0
- /package/ts/{array_plus → array}/reduce_while.ts +0 -0
- /package/ts/{array_plus → array}/reverse.ts +0 -0
- /package/ts/{array_plus → array}/tail.ts +0 -0
- /package/ts/{array_plus → array}/union_of_props.ts +0 -0
- /package/ts/{array_plus → array}/union_of_values.ts +0 -0
- /package/ts/function/{AnyFunction.ts → any_function.ts} +0 -0
- /package/ts/{JSONTypes.ts → json.ts} +0 -0
- /package/ts/{nominal-types/types.ts → nominal/constants.ts} +0 -0
- /package/ts/{UnionToIntersection.ts → union/union_to_intersection.ts} +0 -0
- /package/ts/{UnionKeys.ts → union_keys.ts} +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { IsAnyOrNever } from '../any/any_or_never.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if the type `T` is exactly `bigint`.
|
|
5
|
+
*
|
|
6
|
+
* ```
|
|
7
|
+
* import type { StrictBigintType } from 'type-plus'
|
|
8
|
+
*
|
|
9
|
+
* type R = StrictBigintType<bigint> // bigint
|
|
10
|
+
*
|
|
11
|
+
* type R = StrictBigintType<1n> // never
|
|
12
|
+
* type R = StrictBigintType<number> // never
|
|
13
|
+
* type R = StrictBigintType<bigint | boolean> // never
|
|
14
|
+
* type R = StrictBigintType<unknown> // never
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export type StrictBigintType<T, Then = T, Else = never> = IsAnyOrNever<
|
|
18
|
+
T,
|
|
19
|
+
Else,
|
|
20
|
+
[bigint] extends [T] ? ([T] extends [bigint] ? (`${T}` extends `${number}` ? Else : Then) : Else) : Else
|
|
21
|
+
>
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Is the type `T` exactly `bigint`.
|
|
25
|
+
*
|
|
26
|
+
* ```
|
|
27
|
+
* import type { IsStrictBigint } from 'type-plus'
|
|
28
|
+
*
|
|
29
|
+
* type R = IsStrictBigint<bigint> // true
|
|
30
|
+
*
|
|
31
|
+
* type R = IsStrictBigint<1n> // false
|
|
32
|
+
* type R = IsStrictBigint<number> // false
|
|
33
|
+
* type R = IsStrictBigint<bigint | boolean> // false
|
|
34
|
+
* type R = IsStrictBigint<unknown> // false
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export type IsStrictBigint<T, Then = true, Else = false> = StrictBigintType<T, Then, Else>
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Check if the type `T` is not exactly `bigint`.
|
|
41
|
+
*
|
|
42
|
+
* ```
|
|
43
|
+
* import type { NotStrictBigintType } from 'type-plus'
|
|
44
|
+
*
|
|
45
|
+
* type R = NotStrictBigintType<bigint> // never
|
|
46
|
+
*
|
|
47
|
+
* type R = NotStrictBigintType<1n> // 1n
|
|
48
|
+
* type R = NotStrictBigintType<number> // number
|
|
49
|
+
* type R = NotStrictBigintType<bigint | boolean> // string | boolean
|
|
50
|
+
* type R = NotStrictBigintType<unknown> // unknown
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export type NotStrictBigintType<T, Then = T, Else = never> = StrictBigintType<T, Else, Then>
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Is the type `T` not exactly `bigint`.
|
|
57
|
+
*
|
|
58
|
+
* ```
|
|
59
|
+
* import type { IsNotStrictBigint } from 'type-plus'
|
|
60
|
+
*
|
|
61
|
+
* type R = IsNotStrictBigint<bigint> // false
|
|
62
|
+
*
|
|
63
|
+
* type R = IsNotStrictBigint<1n> // true
|
|
64
|
+
* type R = IsNotStrictBigint<number> // true
|
|
65
|
+
* type R = IsNotStrictBigint<bigint | boolean> // true
|
|
66
|
+
* type R = IsNotStrictBigint<unknown> // true
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export type IsNotStrictBigint<T, Then = true, Else = false> = StrictBigintType<T, Else, Then>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { IsAnyOrNever } from '../any/any_or_never.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if the type `T` is `boolean`, including `true` and `false`.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import type { BooleanType } from 'type-plus'
|
|
8
|
+
*
|
|
9
|
+
* type R = BooleanType<boolean> // boolean
|
|
10
|
+
* type R = BooleanType<true> // true
|
|
11
|
+
* type R = BooleanType<false> // false
|
|
12
|
+
*
|
|
13
|
+
* type R = BooleanType<number> // never
|
|
14
|
+
* type R = BooleanType<unknown> // never
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export type BooleanType<T, Then = T, Else = never> = IsAnyOrNever<
|
|
18
|
+
T,
|
|
19
|
+
Else,
|
|
20
|
+
[T] extends [boolean] ? Then : Else
|
|
21
|
+
>
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Check if the type `T` is not `boolean`, including `true` and `false`.
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* import type { NotBooleanType } from 'type-plus'
|
|
28
|
+
*
|
|
29
|
+
* type R = NotBooleanType<boolean> // never
|
|
30
|
+
* type R = NotBooleanType<true> // never
|
|
31
|
+
* type R = NotBooleanType<false> // never
|
|
32
|
+
*
|
|
33
|
+
* type R = NotBooleanType<number> // number
|
|
34
|
+
* type R = NotBooleanType<unknown> // unknown
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export type NotBooleanType<T, Then = T, Else = never> = BooleanType<T, Else, Then>
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Is the type `T` `boolean`, including `true` and `false`.
|
|
41
|
+
*
|
|
42
|
+
* ```ts
|
|
43
|
+
* import type { IsBoolean } from 'type-plus'
|
|
44
|
+
*
|
|
45
|
+
* type R = IsBoolean<boolean> // true
|
|
46
|
+
* type R = IsBoolean<true> // true
|
|
47
|
+
* type R = IsBoolean<false> // true
|
|
48
|
+
*
|
|
49
|
+
* type R = IsBoolean<number> // false
|
|
50
|
+
* type R = IsBoolean<unknown> // false
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export type IsBoolean<T, Then = true, Else = false> = BooleanType<T, Then, Else>
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Is the type `T` not `boolean`, including `true` and `false`.
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* import type { IsNotBoolean } from 'type-plus'
|
|
60
|
+
*
|
|
61
|
+
* type R = IsNotBoolean<boolean> // false
|
|
62
|
+
* type R = IsNotBoolean<true> // false
|
|
63
|
+
* type R = IsNotBoolean<false> // false
|
|
64
|
+
*
|
|
65
|
+
* type R = IsNotBoolean<number> // true
|
|
66
|
+
* type R = IsNotBoolean<unknown> // true
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export type IsNotBoolean<T, Then = true, Else = false> = BooleanType<T, Else, Then>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { IsAnyOrNever } from '../any/any_or_never.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if the type `T` is exactly `false`.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import type { FalseType } from 'type-plus'
|
|
8
|
+
*
|
|
9
|
+
* type R = FalseType<false> // false
|
|
10
|
+
*
|
|
11
|
+
* type R = FalseType<true> // never
|
|
12
|
+
* type R = FalseType<unknown> // never
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export type FalseType<T, Then = T, Else = never> = IsAnyOrNever<
|
|
16
|
+
T,
|
|
17
|
+
Else,
|
|
18
|
+
[T, false] extends [false, T] ? Then : Else
|
|
19
|
+
>
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Check if the type `T` is not exactly `false`.
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* import type { NotFalseType } from 'type-plus'
|
|
26
|
+
*
|
|
27
|
+
* type R = NotFalseType<false> // never
|
|
28
|
+
*
|
|
29
|
+
* type R = NotFalseType<true> // true
|
|
30
|
+
* type R = NotFalseType<unknown> // unknown
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export type NotFalseType<T, Then = T, Else = never> = FalseType<T, Else, Then>
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Is the type `T` exactly `false`.
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* import type { IsFalse } from 'type-plus'
|
|
40
|
+
*
|
|
41
|
+
* type R = IsFalse<false> // true
|
|
42
|
+
*
|
|
43
|
+
* type R = IsFalse<true> // false
|
|
44
|
+
* type R = IsFalse<unknown> // false
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export type IsFalse<T, Then = true, Else = false> = FalseType<T, Then, Else>
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Is the type `T` not exactly `false`.
|
|
51
|
+
*
|
|
52
|
+
* ```ts
|
|
53
|
+
* import type { IsNotFalse } from 'type-plus'
|
|
54
|
+
*
|
|
55
|
+
* type R = IsNotFalse<false> // false
|
|
56
|
+
*
|
|
57
|
+
* type R = IsNotFalse<true> // true
|
|
58
|
+
* type R = IsNotFalse<unknown> // true
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export type IsNotFalse<T, Then = true, Else = false> = FalseType<T, Else, Then>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# boolean
|
|
2
|
+
|
|
3
|
+
`boolean` is a type that represents the two values: `true` and `false`.
|
|
4
|
+
|
|
5
|
+
Unlike other types, `boolean` is a primitive union type.
|
|
6
|
+
It is exactly equivalent to the union type `true | false`.
|
|
7
|
+
|
|
8
|
+
## Type Checking
|
|
9
|
+
|
|
10
|
+
The `BooleanType<T>` and friends are used to check if a type is `boolean` or not.
|
|
11
|
+
|
|
12
|
+
It matches `boolean`, `true`, and `false`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import type { BooleanType } from 'type-plus'
|
|
16
|
+
|
|
17
|
+
type R = BooleanType<boolean> // boolean
|
|
18
|
+
type R = BooleanType<true> // true
|
|
19
|
+
type R = BooleanType<false> // false
|
|
20
|
+
|
|
21
|
+
type R = BooleanType<1> // never
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- [`BooleanType<T, Then = T, Else = never>`](boolean_type.ts#L17): check if `T` is `boolean`, `true`, or `false`.
|
|
25
|
+
- [`IsBoolean<T, Then = true, Else = false`](boolean_type.ts#L37): is `T` `boolean`.
|
|
26
|
+
- [`NotBooleanType<T, Then = T, Else = never>`](boolean_type.ts#L53): check if `T` is not `boolean`, `true`, nor `false`.
|
|
27
|
+
- [`IsNotBoolean<T, Then = true, Else = false>`](boolean_type.ts#L69): is `T` not `boolean`.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
The `StrictBooleanType<T>` and friends are used to check if a type is exactly `boolean` or not.
|
|
32
|
+
|
|
33
|
+
It matches only the type `boolean`.
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import type { StrictBooleanType } from 'type-plus'
|
|
37
|
+
|
|
38
|
+
type R = StrictBooleanType<boolean> // boolean
|
|
39
|
+
|
|
40
|
+
type R = StrictBooleanType<true> // never
|
|
41
|
+
type R = StrictBooleanType<false> // never
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- [`StrictBooleanType<T, Then = T, Else = never>`](strict_boolean_type.ts#L16): check if `T` is exactly `boolean`.
|
|
45
|
+
- [`IsStrictBoolean<T, Then = true, Else = false`](strict_boolean_type.ts#L50): is `T` exactly `boolean`.
|
|
46
|
+
- [`NotStrictBooleanType<T, Then = T, Else = never>`](strict_boolean_type.ts#L35): check if `T` is not exactly `boolean`.
|
|
47
|
+
- [`IsNotStrictBoolean<T, Then = true, Else = false>`](strict_boolean_type.ts#L65): is `T` not exactly `boolean`.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
The `TrueType<T>` and friends are used to check if a type is `true` or not.
|
|
52
|
+
|
|
53
|
+
It matches only `true`.
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import type { TrueType } from 'type-plus'
|
|
57
|
+
|
|
58
|
+
type R = TrueType<true> // true
|
|
59
|
+
|
|
60
|
+
type R = TrueType<boolean> // never
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
- [`TrueType<T, Then = T, Else = never>`](true_type.ts#L16): check if `T` is `true`.
|
|
64
|
+
- [`IsTrue<T, Then = true, Else = false`](true_type.ts#L35): is `T` `true`.
|
|
65
|
+
- [`NotTrueType<T, Then = T, Else = never>`](true_type.ts#L49): check if `T` is not `true`.
|
|
66
|
+
- [`IsNotTrue<T, Then = true, Else = false>`](true_type.ts#L63): is `T` not `true`.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
The `FalseType<T>` and friends are used to check if a type is `false` or not.
|
|
71
|
+
|
|
72
|
+
It matches only `false`.
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import type { FalseType } from 'type-plus'
|
|
76
|
+
|
|
77
|
+
type R = FalseType<false> // false
|
|
78
|
+
|
|
79
|
+
type R = FalseType<boolean> // never
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
- [`FalseType<T, Then = T, Else = never>`](false_type.ts#L16): check if `T` is `false`.
|
|
83
|
+
- [`IsFalse<T, Then = true, Else = false`](false_type.ts#L35): is `T` `false`.
|
|
84
|
+
- [`NotFalseType<T, Then = T, Else = never>`](false_type.ts#L49): check if `T` is not `false`.
|
|
85
|
+
- [`IsNotFalse<T, Then = true, Else = false>`](false_type.ts#L63): is `T` not `false`.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { IsAnyOrNever } from '../any/any_or_never.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if the type `T` is exactly `boolean`.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import type { StrictBooleanType } from 'type-plus'
|
|
8
|
+
*
|
|
9
|
+
* type R = StrictBooleanType<boolean> // true
|
|
10
|
+
*
|
|
11
|
+
* type R = StrictBooleanType<true> // never
|
|
12
|
+
* type R = StrictBooleanType<false> // never
|
|
13
|
+
* type R = StrictBooleanType<unknown> // never
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export type StrictBooleanType<T, Then = T, Else = never> = IsAnyOrNever<
|
|
17
|
+
T,
|
|
18
|
+
Else,
|
|
19
|
+
[T, boolean] extends [boolean, T] ? Then : Else
|
|
20
|
+
>
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Check if the type `T` is not exactly `boolean`.
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* import type { NotStrictBooleanType } from 'type-plus'
|
|
27
|
+
*
|
|
28
|
+
* type R = NotStrictBooleanType<boolean> // never
|
|
29
|
+
*
|
|
30
|
+
* type R = NotStrictBooleanType<true> // true
|
|
31
|
+
* type R = NotStrictBooleanType<false> // false
|
|
32
|
+
* type R = NotStrictBooleanType<unknown> // unknown
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export type NotStrictBooleanType<T, Then = T, Else = never> = StrictBooleanType<T, Else, Then>
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Is the type `T` exactly `boolean`.
|
|
39
|
+
*
|
|
40
|
+
* ```ts
|
|
41
|
+
* import type { IsStrictBoolean } from 'type-plus'
|
|
42
|
+
*
|
|
43
|
+
* type R = IsStrictBoolean<boolean> // true
|
|
44
|
+
*
|
|
45
|
+
* type R = IsStrictBoolean<true> // false
|
|
46
|
+
* type R = IsStrictBoolean<false> // true
|
|
47
|
+
* type R = IsStrictBoolean<unknown> // false
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export type IsStrictBoolean<T, Then = true, Else = false> = StrictBooleanType<T, Then, Else>
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Is the type `T` not exactly `false`.
|
|
54
|
+
*
|
|
55
|
+
* ```ts
|
|
56
|
+
* import type { IsNotStrictBoolean } from 'type-plus'
|
|
57
|
+
*
|
|
58
|
+
* type R = IsNotStrictBoolean<boolean> // false
|
|
59
|
+
*
|
|
60
|
+
* type R = IsNotStrictBoolean<true> // true
|
|
61
|
+
* type R = IsNotStrictBoolean<false> // false
|
|
62
|
+
* type R = IsNotStrictBoolean<unknown> // true
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export type IsNotStrictBoolean<T, Then = true, Else = false> = StrictBooleanType<T, Else, Then>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { IsAnyOrNever } from '../any/any_or_never.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if the type `T` is exactly `true`.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import type { TrueType } from 'type-plus'
|
|
8
|
+
*
|
|
9
|
+
* type R = TrueType<true> // true
|
|
10
|
+
*
|
|
11
|
+
* type R = TrueType<false> // never
|
|
12
|
+
* type R = TrueType<unknown> // never
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export type TrueType<T, Then = T, Else = never> = IsAnyOrNever<
|
|
16
|
+
T,
|
|
17
|
+
Else,
|
|
18
|
+
[T, true] extends [true, T] ? Then : Else
|
|
19
|
+
>
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Check if the type `T` is not exactly `true`.
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* import type { NotTrueType } from 'type-plus'
|
|
26
|
+
*
|
|
27
|
+
* type R = NotTrueType<true> // never
|
|
28
|
+
*
|
|
29
|
+
* type R = NotTrueType<false> // false
|
|
30
|
+
* type R = NotTrueType<unknown> // unknown
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export type NotTrueType<T, Then = T, Else = never> = TrueType<T, Else, Then>
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Is the type `T` exactly `true`.
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* import type { IsTrue } from 'type-plus'
|
|
40
|
+
*
|
|
41
|
+
* type R = IsTrue<true> // true
|
|
42
|
+
*
|
|
43
|
+
* type R = IsTrue<false> // false
|
|
44
|
+
* type R = IsTrue<unknown> // false
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export type IsTrue<T, Then = true, Else = false> = TrueType<T, Then, Else>
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Is the type `T` not exactly `true`.
|
|
51
|
+
*
|
|
52
|
+
* ```ts
|
|
53
|
+
* import type { IsNotTrue } from 'type-plus'
|
|
54
|
+
*
|
|
55
|
+
* type R = IsNotTrue<true> // false
|
|
56
|
+
*
|
|
57
|
+
* type R = IsNotTrue<false> // true
|
|
58
|
+
* type R = IsNotTrue<unknown> // true
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export type IsNotTrue<T, Then = true, Else = false> = TrueType<T, Else, Then>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types that can contain custom properties.
|
|
3
|
+
*/
|
|
4
|
+
export type ComposableTypes = object | Function
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Types that cannot contain custom properties.
|
|
8
|
+
*/
|
|
9
|
+
export type NonComposableTypes = boolean | number | string | symbol | bigint | undefined | null
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { IsAny } from '../any/any_type.js'
|
|
2
|
+
import type { IsNever } from '../never/never_type.js'
|
|
3
|
+
import type { IsObject } from '../object/object_type.js'
|
|
4
|
+
import type { Properties } from '../object/properties.js'
|
|
5
|
+
import type { And, Or } from '../predicates/logical.js'
|
|
6
|
+
import type { IsSymbol } from '../symbol/symbol_type.js'
|
|
7
|
+
|
|
8
|
+
type BothNever<A, B, Both, One, None> = And<
|
|
9
|
+
IsNever<A>,
|
|
10
|
+
IsNever<B>,
|
|
11
|
+
Both,
|
|
12
|
+
Or<IsNever<A>, IsNever<B>, One, None>
|
|
13
|
+
>
|
|
14
|
+
|
|
15
|
+
type BothAny<A, B, Both, One, None> = And<IsAny<A>, IsAny<B>, Both, Or<IsAny<A>, IsAny<B>, One, None>>
|
|
16
|
+
|
|
17
|
+
type IdentityEqual<A, B, Then, Else> = (<_>() => _ extends (A & _) | _ ? 1 : 2) extends <_>() => _ extends
|
|
18
|
+
| (B & _)
|
|
19
|
+
| _
|
|
20
|
+
? 1
|
|
21
|
+
: 2
|
|
22
|
+
? Then
|
|
23
|
+
: Else
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Checks `A` and `B` are equal.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* import { type Equal } from 'type-plus'
|
|
30
|
+
*
|
|
31
|
+
* type R = Equal<1, 1> // true
|
|
32
|
+
* type R = Equal<any, any> // true
|
|
33
|
+
* type R = Equal<boolean, boolean> // true
|
|
34
|
+
* type R = Equal<true, true> // true
|
|
35
|
+
* type R = Equal<[1], [1]> // true
|
|
36
|
+
*
|
|
37
|
+
* type R = Equal<boolean, true> // false
|
|
38
|
+
* type R = Equal<any, 1> // false
|
|
39
|
+
* type R = Equal<[any], [1]> // false
|
|
40
|
+
* type R = Equal<{ a: 1 }, { a: 1; b: 2 }> // false
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export type Equal<A, B, Then = true, Else = false> = [A, B] extends [B, A]
|
|
44
|
+
? BothNever<
|
|
45
|
+
A,
|
|
46
|
+
B,
|
|
47
|
+
Then,
|
|
48
|
+
Else,
|
|
49
|
+
BothAny<
|
|
50
|
+
A,
|
|
51
|
+
B,
|
|
52
|
+
Then,
|
|
53
|
+
Else,
|
|
54
|
+
IdentityEqual<
|
|
55
|
+
A,
|
|
56
|
+
B,
|
|
57
|
+
Then,
|
|
58
|
+
And<
|
|
59
|
+
IsObject<A>,
|
|
60
|
+
IsObject<B>,
|
|
61
|
+
IdentityEqual<Properties<A>, Properties<B>, Then, Else>,
|
|
62
|
+
// `A` and `B` are narrowed, need to check again.
|
|
63
|
+
[A, B] extends [B, A] ? Then : Else
|
|
64
|
+
>
|
|
65
|
+
>
|
|
66
|
+
>
|
|
67
|
+
>
|
|
68
|
+
: And<IsSymbol<A>, IsSymbol<B>, Then, Else>
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Checks `A` and `B` are not equal.
|
|
72
|
+
*
|
|
73
|
+
* ```ts
|
|
74
|
+
* import { type NotEqual } from 'type-plus'
|
|
75
|
+
*
|
|
76
|
+
* type R = NotEqual<1, 1> // false
|
|
77
|
+
* type R = NotEqual<any, any> // false
|
|
78
|
+
* type R = NotEqual<boolean, boolean> // false
|
|
79
|
+
* type R = NotEqual<true, true> // false
|
|
80
|
+
* type R = NotEqual<[1], [1]> // false
|
|
81
|
+
*
|
|
82
|
+
* type R = NotEqual<boolean, true> // true
|
|
83
|
+
* type R = NotEqual<any, 1> // true
|
|
84
|
+
* type R = NotEqual<[any], [1]> // true
|
|
85
|
+
* type R = NotEqual<{ a: 1 }, { a: 1; b: 2 }> // true
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export type NotEqual<A, B, Then = true, Else = false> = Equal<A, B, Else, Then>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Equal
|
|
2
|
+
|
|
3
|
+
`Equal<A, B>` and friends check if `A` and `B` are equal.
|
|
4
|
+
|
|
5
|
+
It is a type-level version of `===`.
|
|
6
|
+
It handles special types (`any`, `unknown`, `never`, `void`) correctly.
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { type Equal } from 'type-plus'
|
|
10
|
+
|
|
11
|
+
type R = Equal<1, 1> // true
|
|
12
|
+
type R = Equal<any, any> // true
|
|
13
|
+
type R = Equal<boolean, boolean> // true
|
|
14
|
+
type R = Equal<true, true> // true
|
|
15
|
+
type R = Equal<[1], [1]> // true
|
|
16
|
+
|
|
17
|
+
type R = Equal<boolean, true> // false
|
|
18
|
+
type R = Equal<any, 1> // false
|
|
19
|
+
type R = Equal<[any], [1]> // false
|
|
20
|
+
type R = Equal<{ a: 1 }, { a: 1; b: 2 }> // false
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
- [`Equal<A, B, Then = true, Else = false>`](equal.ts#L27): check if `A` and `B` are equal.
|
|
24
|
+
- [`NotEqual<A, B, Then = true, Else = false>`](equal.ts#L88): check if `A` and `B` are not equal.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
[![Just Code: Equality is hard][equality-is-hard]][equality-is-hard-url]
|
|
29
|
+
|
|
30
|
+
[equality-is-hard]: https://img.youtube.com/vi/VEqrFzCzo28/0.jpg
|
|
31
|
+
[equality-is-hard-url]: https://www.youtube.com/watch?v=VEqrFzCzo28
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AnyFunction } from './any_function.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Extract the function signature from a composite type T.
|
|
5
|
+
*
|
|
6
|
+
* It works with interact of functions, but not on function overloads and union.
|
|
7
|
+
* @note does not work with function overloads.
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import type { ExtractFunction } from 'type-plus'
|
|
11
|
+
*
|
|
12
|
+
* type R = ExtractFunction<{
|
|
13
|
+
* () => void
|
|
14
|
+
* a: 1
|
|
15
|
+
* }> // () => void
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export type ExtractFunction<T extends AnyFunction> = T extends AnyFunction<infer P, infer R>
|
|
19
|
+
? (...args: P) => R
|
|
20
|
+
: never
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Extract the function signature from a composite function.
|
|
24
|
+
*
|
|
25
|
+
* @note does not work with function overloads.
|
|
26
|
+
*/
|
|
27
|
+
export function extractFunction<T extends AnyFunction>(fn: T) {
|
|
28
|
+
return fn as unknown as ExtractFunction<T>
|
|
29
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { IsAnyOrNever } from '../any/any_or_never.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if `T` is a `Function`.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import type { FunctionType } from 'type-plus'
|
|
8
|
+
*
|
|
9
|
+
* type R = FunctionType<Function> // Function
|
|
10
|
+
* type R = FunctionType<() => void> // () => void
|
|
11
|
+
* type R = FunctionType<(() => void) | { a: 1 }> // (() => void) | { a: 1 }
|
|
12
|
+
*
|
|
13
|
+
* type R = FunctionType<{ a: 1 }> // never
|
|
14
|
+
* type R = FunctionType<never> // never
|
|
15
|
+
* type R = FunctionType<unknown> // never
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export type FunctionType<T, Then = T, Else = never> = IsAnyOrNever<
|
|
19
|
+
T,
|
|
20
|
+
Else,
|
|
21
|
+
[T] extends [Function] ? Then : Else
|
|
22
|
+
>
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Is `T` a `Function`.
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* import type { IsFunction } from 'type-plus'
|
|
29
|
+
*
|
|
30
|
+
* type R = IsFunction<Function> // Function
|
|
31
|
+
* type R = IsFunction<() => void> // () => void
|
|
32
|
+
* type R = IsFunction<(() => void) | { a: 1 }> // (() => void) | { a: 1 }
|
|
33
|
+
*
|
|
34
|
+
* type R = IsFunction<{ a: 1 }> // never
|
|
35
|
+
* type R = IsFunction<never> // never
|
|
36
|
+
* type R = IsFunction<unknown> // never
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export type IsFunction<T, Then = true, Else = false> = FunctionType<T, Then, Else>
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Check if `T` is not a `Function`.
|
|
43
|
+
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* import type { NotFunctionType } from 'type-plus'
|
|
46
|
+
*
|
|
47
|
+
* type R = NotFunctionType<Function> // never
|
|
48
|
+
* type R = NotFunctionType<() => void> // never
|
|
49
|
+
* type R = NotFunctionType<(() => void) | { a: 1 }> // never
|
|
50
|
+
*
|
|
51
|
+
* type R = NotFunctionType<{ a: 1 }> // { a: 1 }
|
|
52
|
+
* type R = NotFunctionType<never> // never
|
|
53
|
+
* type R = NotFunctionType<unknown> // unknown
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export type NotFunctionType<T, Then = T, Else = never> = FunctionType<T, Else, Then>
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Is `T` not a `Function`.
|
|
60
|
+
*
|
|
61
|
+
* ```ts
|
|
62
|
+
* import type { IsNotFunction } from 'type-plus'
|
|
63
|
+
*
|
|
64
|
+
* type R = IsNotFunction<Function> // false
|
|
65
|
+
* type R = IsNotFunction<() => void> // false
|
|
66
|
+
* type R = IsNotFunction<(() => void) | { a: 1 }> // false
|
|
67
|
+
*
|
|
68
|
+
* type R = IsNotFunction<{ a: 1 }> // true
|
|
69
|
+
* type R = IsNotFunction<never> // true
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export type IsNotFunction<T, Then = true, Else = false> = FunctionType<T, Else, Then>
|