type-plus 6.2.0 → 6.4.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 +40 -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 +43 -14
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +11 -14
- 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 +21 -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/flavor.d.ts +20 -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/nominal/types.d.ts.map +1 -0
- package/cjs/nominal/types.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/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_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/union_to_intersection.d.ts +3 -0
- package/cjs/union_to_intersection.d.ts.map +1 -0
- package/cjs/union_to_intersection.js +8 -0
- package/cjs/union_to_intersection.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 +43 -14
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +8 -11
- 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 +21 -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/flavor.d.ts +20 -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/nominal/types.d.ts.map +1 -0
- package/esm/nominal/types.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/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_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/union_to_intersection.d.ts +3 -0
- package/esm/union_to_intersection.d.ts.map +1 -0
- package/esm/union_to_intersection.js +4 -0
- package/esm/union_to_intersection.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 +7 -25
- 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 +15 -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 +90 -18
- 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 +35 -0
- package/ts/nominal/flavor.ts +38 -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 +27 -0
- package/ts/tuple/tuple_type.ts +72 -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.map +0 -1
- 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 -19
- 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/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.map +0 -1
- 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 -19
- 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/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 -24
- package/ts/testing/index.ts +0 -1
- /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/{nominal-types → nominal}/types.d.ts +0 -0
- /package/cjs/{nominal-types → nominal}/types.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/{nominal-types → nominal}/types.d.ts +0 -0
- /package/esm/{nominal-types → nominal}/types.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 → nominal}/types.ts +0 -0
- /package/ts/{UnionKeys.ts → union_keys.ts} +0 -0
- /package/ts/{UnionToIntersection.ts → union_to_intersection.ts} +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { IsAny } from '../any/any_type.js'
|
|
2
|
+
import type { IsNever } from '../never/never_type.js'
|
|
3
|
+
import type { Zero } from './numeric_type.js'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Check if 'T' is a negative numeric type.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import type { Negative } from 'type-plus'
|
|
10
|
+
*
|
|
11
|
+
* type R = Negative<-1> // -1
|
|
12
|
+
* type R = Negative<-1n> // -1n
|
|
13
|
+
*
|
|
14
|
+
* type R = Negative<number> // number
|
|
15
|
+
* type R = Negative<any> // any
|
|
16
|
+
*
|
|
17
|
+
* type R = Negative<0> // never
|
|
18
|
+
* type R = Negative<1> // never
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export type Negative<T, Then = T, Else = never> = IsAny<
|
|
22
|
+
T,
|
|
23
|
+
Then | Else,
|
|
24
|
+
IsNever<
|
|
25
|
+
T,
|
|
26
|
+
Else,
|
|
27
|
+
[number, T] extends [T, number]
|
|
28
|
+
? Then
|
|
29
|
+
: [bigint, T] extends [T, bigint]
|
|
30
|
+
? Then
|
|
31
|
+
: T extends Zero
|
|
32
|
+
? Else
|
|
33
|
+
: [T] extends [number | bigint]
|
|
34
|
+
? `${T}` extends `-${string}`
|
|
35
|
+
? Then
|
|
36
|
+
: Else
|
|
37
|
+
: Else
|
|
38
|
+
>
|
|
39
|
+
>
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Is 'T' a negative numeric type.
|
|
43
|
+
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* import type { IsNegative } from 'type-plus'
|
|
46
|
+
*
|
|
47
|
+
* type R = IsNegative<-1> // true
|
|
48
|
+
* type R = IsNegative<-1n> // true
|
|
49
|
+
*
|
|
50
|
+
* type R = IsNegative<number> // boolean
|
|
51
|
+
* type R = IsNegative<any> // boolean
|
|
52
|
+
*
|
|
53
|
+
* type R = IsNegative<0> // false
|
|
54
|
+
* type R = IsNegative<1> // false
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export type IsNegative<T, Then = true, Else = false> = Negative<T, Then, Else>
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Check if 'T' is not a negative numeric type.
|
|
61
|
+
*
|
|
62
|
+
* ```ts
|
|
63
|
+
* import type { NotNegative } from 'type-plus'
|
|
64
|
+
*
|
|
65
|
+
* type R = NotNegative<-1> // never
|
|
66
|
+
* type R = NotNegative<-1n> // never
|
|
67
|
+
*
|
|
68
|
+
* type R = NotNegative<number> // number
|
|
69
|
+
* type R = NotNegative<any> // any
|
|
70
|
+
*
|
|
71
|
+
* type R = NotNegative<0> // 0
|
|
72
|
+
* type R = NotNegative<1> // 1
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export type NotNegative<T, Then = T, Else = never> = IsAny<
|
|
76
|
+
T,
|
|
77
|
+
Then | Else,
|
|
78
|
+
IsNever<
|
|
79
|
+
T,
|
|
80
|
+
Then,
|
|
81
|
+
[number, T] extends [T, number]
|
|
82
|
+
? Then
|
|
83
|
+
: [bigint, T] extends [T, bigint]
|
|
84
|
+
? Then
|
|
85
|
+
: [T] extends [number | bigint]
|
|
86
|
+
? `${T}` extends `-${string}`
|
|
87
|
+
? Else
|
|
88
|
+
: Then
|
|
89
|
+
: Then
|
|
90
|
+
>
|
|
91
|
+
>
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Is 'T' not a negative numeric type.
|
|
95
|
+
*
|
|
96
|
+
* ```ts
|
|
97
|
+
* import type { IsNotNegative } from 'type-plus'
|
|
98
|
+
*
|
|
99
|
+
* type R = IsNotNegative<-1> // false
|
|
100
|
+
* type R = IsNotNegative<-1n> // false
|
|
101
|
+
*
|
|
102
|
+
* type R = IsNotNegative<number> // boolean
|
|
103
|
+
* type R = IsNotNegative<any> // boolean
|
|
104
|
+
*
|
|
105
|
+
* type R = IsNotNegative<0> // true
|
|
106
|
+
* type R = IsNotNegative<1> // true
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export type IsNotNegative<T, Then = true, Else = false> = NotNegative<T, Then, Else>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Add, IsStrictNumber } from '../index.js'
|
|
2
|
+
|
|
3
|
+
export type Sum<A extends number[], Fail = never> = IsStrictNumber<
|
|
4
|
+
A['length'],
|
|
5
|
+
Fail,
|
|
6
|
+
A['length'] extends 0
|
|
7
|
+
? 0
|
|
8
|
+
: A['length'] extends 1
|
|
9
|
+
? A[0]
|
|
10
|
+
: A['length'] extends 2
|
|
11
|
+
? Add<A[0], A[1]>
|
|
12
|
+
: A extends [infer F extends number, infer S extends number, ...infer Tail extends number[]]
|
|
13
|
+
? Sum<[Add<F, S>, ...Tail]>
|
|
14
|
+
: never
|
|
15
|
+
>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type { Integer, IsInteger, IsNotInteger, IsWhole, NotInteger } from './integer.js'
|
|
2
|
+
export type { IsNegative, IsNotNegative, Negative, NotNegative } from './negative.js'
|
|
3
|
+
export type { Sum } from './number_array.js'
|
|
4
|
+
export type { IsNotNumber, IsNumber, NotNumberType, NumberType } from './number_type.js'
|
|
5
|
+
export type {
|
|
6
|
+
IsNotNumeric,
|
|
7
|
+
IsNumeric,
|
|
8
|
+
NotNumericType,
|
|
9
|
+
Numeric,
|
|
10
|
+
NumericType,
|
|
11
|
+
Zero
|
|
12
|
+
} from './numeric_type.js'
|
|
13
|
+
export type { IsNotPositive, IsPositive, NonPositive, Positive } from './positive.js'
|
|
14
|
+
export type {
|
|
15
|
+
IsNotStrictNumber,
|
|
16
|
+
IsStrictNumber,
|
|
17
|
+
NotStrictNumberType,
|
|
18
|
+
StrictNumberType
|
|
19
|
+
} from './strict_number_type.js'
|
|
20
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { IsAnyOrNever } from '../any/any_or_never.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if the type `T` is `number`.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import type { NumberType } from 'type-plus'
|
|
8
|
+
*
|
|
9
|
+
* type R = NumberType<number> // true
|
|
10
|
+
* type R = NumberType<1> // true
|
|
11
|
+
*
|
|
12
|
+
* type R = NumberType<never> // false
|
|
13
|
+
* type R = NumberType<unknown> // false
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export type NumberType<T, Then = T, Else = never> = IsAnyOrNever<T, Else, [T] extends [number] ? Then : Else>
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Is the type `T` is `number`.
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import type { IsNumber } from 'type-plus'
|
|
23
|
+
*
|
|
24
|
+
* type R = IsNumber<number> // true
|
|
25
|
+
* type R = IsNumber<1> // true
|
|
26
|
+
*
|
|
27
|
+
* type R = IsNumber<never> // false
|
|
28
|
+
* type R = IsNumber<unknown> // false
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export type IsNumber<T, Then = true, Else = false> = NumberType<T, Then, Else>
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Check if the type `T` is not `number`.
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* import type { NotNumberType } from 'type-plus'
|
|
38
|
+
*
|
|
39
|
+
* type R = NotNumberType<number> // false
|
|
40
|
+
* type R = NotNumberType<1> // false
|
|
41
|
+
*
|
|
42
|
+
* type R = NotNumberType<never> // true
|
|
43
|
+
* type R = NotNumberType<unknown> // true
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export type NotNumberType<T, Then = T, Else = never> = NumberType<T, Else, Then>
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Is the type `T` not `number`.
|
|
50
|
+
*
|
|
51
|
+
* ```ts
|
|
52
|
+
* import type { IsNotNumber } from 'type-plus'
|
|
53
|
+
*
|
|
54
|
+
* type R = IsNotNumber<number> // false
|
|
55
|
+
* type R = IsNotNumber<1> // false
|
|
56
|
+
*
|
|
57
|
+
* type R = IsNotNumber<never> // true
|
|
58
|
+
* type R = IsNotNumber<unknown> // true
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export type IsNotNumber<T, Then = true, Else = false> = NumberType<T, Else, Then>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { IsAnyOrNever } from '../any/any_or_never.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Either number or bigint.
|
|
5
|
+
*/
|
|
6
|
+
export type Numeric = number | bigint
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The value 0 in number or bigint.
|
|
10
|
+
*/
|
|
11
|
+
export type Zero = 0 | 0n
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Check if `T` is numeric.
|
|
15
|
+
* Meaning it is either a `number` or a `bigint`.
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* import type { NumericType } from 'type-plus'
|
|
19
|
+
*
|
|
20
|
+
* type R = NumericType<1> // 1
|
|
21
|
+
* type R = NumericType<1.1> // 1.1
|
|
22
|
+
*
|
|
23
|
+
* type R = NumericType<string> // never
|
|
24
|
+
* type R = NumericType<unknown> // never
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export type NumericType<T, Then = T, Else = never> = IsAnyOrNever<T, Else, [T] extends [Numeric] ? Then : Else>
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Is `T` numeric.
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* import type { IsNumeric } from 'type-plus'
|
|
34
|
+
*
|
|
35
|
+
* type R = IsNumeric<1> // true
|
|
36
|
+
* type R = IsNumeric<1.1> // true
|
|
37
|
+
*
|
|
38
|
+
* type R = IsNumeric<string> // false
|
|
39
|
+
* type R = IsNumeric<unknown> // false
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export type IsNumeric<T, Then = true, Else = false> = NumericType<T, Then, Else>
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Check if `T` is not numeric.
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* import type { NotNumericType } from 'type-plus'
|
|
49
|
+
*
|
|
50
|
+
* type R = NotNumericType<1> // never
|
|
51
|
+
* type R = NotNumericType<1.1> // never
|
|
52
|
+
*
|
|
53
|
+
* type R = NotNumericType<string> // string
|
|
54
|
+
* type R = NotNumericType<unknown> // unknown
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export type NotNumericType<T, Then = T, Else = never> = NumericType<T, Else, Then>
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Is `T` not numeric.
|
|
61
|
+
*
|
|
62
|
+
* ```ts
|
|
63
|
+
* import type { IsNotNumeric } from 'type-plus'
|
|
64
|
+
*
|
|
65
|
+
* type R = IsNotNumeric<1> // false
|
|
66
|
+
* type R = IsNotNumeric<1.1> // false
|
|
67
|
+
*
|
|
68
|
+
* type R = IsNotNumeric<string> // true
|
|
69
|
+
* type R = IsNotNumeric<unknown> // true
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export type IsNotNumeric<T, Then = true, Else = false> = NumericType<T, Else, Then>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { IsAny } from '../any/any_type.js'
|
|
2
|
+
import { IsNever } from '../index.js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Check if `T` is a positive numeric type.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* import type { Positive } from 'type-plus'
|
|
9
|
+
*
|
|
10
|
+
* type R = Positive<1> // 1
|
|
11
|
+
* type R = Positive<0> // 0
|
|
12
|
+
* type R = Positive<1n> // 1n
|
|
13
|
+
*
|
|
14
|
+
* type R = Positive<-1> // never
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export type Positive<T, Then = T, Else = never> = IsAny<
|
|
18
|
+
T,
|
|
19
|
+
Then | Else,
|
|
20
|
+
IsNever<T, Else, T extends number | bigint ? (`${T}` extends `-${string}` ? Else : Then) : Else>
|
|
21
|
+
>
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Is `T` a positive numeric type.
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* import type { IsPositive } from 'type-plus'
|
|
28
|
+
*
|
|
29
|
+
* type R = IsPositive<1> // true
|
|
30
|
+
* type R = IsPositive<0> // true
|
|
31
|
+
* type R = IsPositive<1n> // true
|
|
32
|
+
*
|
|
33
|
+
* type R = IsPositive<number> // boolean
|
|
34
|
+
* type R = IsPositive<bigint> // boolean
|
|
35
|
+
* type R = IsPosistive<any> // boolean
|
|
36
|
+
*
|
|
37
|
+
* type R = IsPositive<-1> // false
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export type IsPositive<T, Then = true, Else = false> = Positive<T, Then, Else>
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Check if `T` is not a positive numeric type.
|
|
44
|
+
*
|
|
45
|
+
* ```ts
|
|
46
|
+
* import type { NonPositive } from 'type-plus'
|
|
47
|
+
*
|
|
48
|
+
* type R = NonPositive<-1> // -1
|
|
49
|
+
*
|
|
50
|
+
* type R = NonPositive<0> // never
|
|
51
|
+
* type R = NonPositive<1> // never
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export type NonPositive<T, Then = T, Else = never> = Positive<T, Else, Then>
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Is `T` not a positive numeric type.
|
|
58
|
+
*
|
|
59
|
+
* ```ts
|
|
60
|
+
* import type { IsNotPositive } from 'type-plus'
|
|
61
|
+
*
|
|
62
|
+
* type R = IsNotPositive<-1> // true
|
|
63
|
+
*
|
|
64
|
+
* type R = IsNotPositive<0> // false
|
|
65
|
+
* type R = IsNotPositive<1> // false
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export type IsNotPositive<T, Then = true, Else = false> = Positive<T, Else, Then>
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# number
|
|
2
|
+
|
|
3
|
+
## Type Checking
|
|
4
|
+
|
|
5
|
+
The `NumberType<T>` and friends are used to check if `T` is `number` or number literals.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import type { NumberType } from 'type-plus'
|
|
9
|
+
|
|
10
|
+
type R = NumberType<number> // number
|
|
11
|
+
type R = NumberType<1> // 1
|
|
12
|
+
|
|
13
|
+
type R = NumberType<bigint> // never
|
|
14
|
+
type R = NumberType<1n> // never
|
|
15
|
+
type R = NumberType<never> // never
|
|
16
|
+
type R = NumberType<unknown> // never
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- [`NumberType<T, Then = T, Else = never>`](number_type.ts#L16): check if `T` is `number` or number literals.
|
|
20
|
+
- [`IsNumber<T, Then = true, Else = false`](number_type.ts#L35): is `T` `number` or number literals.
|
|
21
|
+
- [`NotNumberType<T, Then = T, Else = never>`](number_type.ts#L46): check if `T` is not `number` nor number literals.
|
|
22
|
+
- [`IsNotNumber<T, Then = true, Else = false>`](number_type.ts#L61): is `T` not `number` nor number literals.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
The `StrictNumberType<T>` and friends are used to check if `T` is exactly `number`.
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import type { StrictNumberType } from 'type-plus'
|
|
30
|
+
|
|
31
|
+
type R = StrictNumberType<number> // number
|
|
32
|
+
|
|
33
|
+
type R = StrictNumberType<1> // never
|
|
34
|
+
type R = StrictNumberType<never> // never
|
|
35
|
+
type R = StrictNumberType<unknown> // never
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- [`StrictNumberType<T, Then = T, Else = never>`](strict_number_type.ts#L16): check if `T` is `number`.
|
|
39
|
+
- [`IsStrictNumber<T, Then = true, Else = false`](strict_number_type.ts#L35): is `T` `number`.
|
|
40
|
+
- [`NotStrictNumberType<T, Then = T, Else = never>`](strict_number_type.ts#L50): check if `T` is not `number`.
|
|
41
|
+
- [`IsNotStrictNumber<T, Then = true, Else = false>`](strict_number_type.ts#L65): is `T` not `number`.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
`Numeric` type is either `number` or `bigint`.
|
|
46
|
+
|
|
47
|
+
The `NumericType<T>` and friends are used to check if `T` is `number` or `bigint`.
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import type { NumericType } from 'type-plus'
|
|
51
|
+
|
|
52
|
+
type R = NumericType<number> // number
|
|
53
|
+
type R = NumericType<bigint> // bigint
|
|
54
|
+
type R = NumericType<1> // 1
|
|
55
|
+
type R = NumericType<1n> // 1n
|
|
56
|
+
|
|
57
|
+
type R = NumericType<never> // never
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
- [`NumericType<T, Then = T, Else = never>`](numeric_type.ts#L27): check if `T` is `number` or `bigint`.
|
|
61
|
+
- [`IsNumeric<T, Then = true, Else = false>`](numeric_type.ts#L42): is `T` `number` or `bigint`.
|
|
62
|
+
- [`NotNumericType<T, Then = T, Else = never>`](numeric_type.ts#L57): check if `T` is not `number` nor `bigint`.
|
|
63
|
+
- [`IsNotNumeric<T, Then = true, Else = false>`](numeric_type.ts#L72): is `T` not `number` nor `bigint`.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
`Integer<T>` and friends are used to check if `T` is an integer.
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import type { Integer } from 'type-plus'
|
|
71
|
+
|
|
72
|
+
type R = Integer<1> // 1
|
|
73
|
+
type R = Integer<1.0> // 1.0
|
|
74
|
+
|
|
75
|
+
type R = Integer<1.1> // never
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- [`Integer<T, Then = T, Else = never>`](integer.ts#L17): check if `T` is an integer.
|
|
79
|
+
- [`IsInteger<T, Then = true, Else = false>`](integer.ts#L36): is `T` an integer.
|
|
80
|
+
- [`NotIntegerType<T, Then = T, Else = never>`](integer.ts#L51): check if `T` is not an integer.
|
|
81
|
+
- [`IsNotInteger<T, Then = true, Else = false>`](integer.ts#L66): is `T` not an integer.
|
|
82
|
+
- [`IsWhole<T, Then = true, Else = false>`](integer.ts#L81): same as `Integer<T>`, will be deprecated in the future.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
`Positive<T>` and friends are used to check if `T` is a positive numeric value.
|
|
87
|
+
|
|
88
|
+
The `number` and `bigint` can be considered as a union of all positive and negative numeric literals.
|
|
89
|
+
|
|
90
|
+
That is why `IsPositive<T>` will yield `boolean` as the union is distributive.
|
|
91
|
+
`Positive<T>` returns `T` for `number` and `bigint` for the same reason.
|
|
92
|
+
It is a bit confusing but it is correct as it really returns `T | never`,
|
|
93
|
+
which resolves to `T`.
|
|
94
|
+
|
|
95
|
+
This behavior is different than `TrueType<T>` which `TrueType<boolean>` returns `never`.
|
|
96
|
+
|
|
97
|
+
This is because `TrueType<T>` is checking for the exect `true` type,
|
|
98
|
+
while `Positive<T>` is checking for a criteria of types (i.e. a set).
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import type { Positive } from 'type-plus'
|
|
102
|
+
|
|
103
|
+
type R = Positive<1> // 1
|
|
104
|
+
type R = Positive<1.0> // 1.0
|
|
105
|
+
type R = Positive<1n> // 1n
|
|
106
|
+
|
|
107
|
+
type R = Positive<-1> // never
|
|
108
|
+
type R = Positive<'1'> // never
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
- [`Positive<T, Then = T, Else = never>`](positive.ts#L17): check if `T` is a positive numeric value.
|
|
112
|
+
- [`IsPositive<T, Then = true, Else = false>`](positive.ts#L40): is `T` a positive numeric value.
|
|
113
|
+
- [`NotPositiveType<T, Then = T, Else = never>`](positive.ts#L54): check if `T` is not a positive numeric value.
|
|
114
|
+
- [`IsNotPositive<T, Then = true, Else = false>`](positive.ts#L68): is `T` not a positive numeric value.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
`Negative<T>` and friends are used to check if `T` is a negative numeric value.
|
|
119
|
+
|
|
120
|
+
The `number` and `bigint` can be considered as a union of all negative and negative numeric literals.
|
|
121
|
+
|
|
122
|
+
That is why `IsNegative<T>` will yield `boolean` as the union is distributive.
|
|
123
|
+
`Negative<T>` returns `T` for `number` and `bigint` for the same reason.
|
|
124
|
+
It is a bit confusing but it is correct as it really returns `T | never`,
|
|
125
|
+
which resolves to `T`.
|
|
126
|
+
|
|
127
|
+
This behavior is different than `TrueType<T>` which `TrueType<boolean>` returns `never`.
|
|
128
|
+
|
|
129
|
+
This is because `TrueType<T>` is checking for the exect `true` type,
|
|
130
|
+
while `Negative<T>` is checking for a criteria of types (i.e. a set).
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
import type { Negative } from 'type-plus'
|
|
134
|
+
|
|
135
|
+
type R = Negative<1> // never
|
|
136
|
+
type R = Negative<1.0> // never
|
|
137
|
+
type R = Negative<1n> // never
|
|
138
|
+
|
|
139
|
+
type R = Negative<number> // number
|
|
140
|
+
type R = Negative<any> // any
|
|
141
|
+
|
|
142
|
+
type R = Negative<-1> // -1
|
|
143
|
+
type R = Negative<'1'> // '1'
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
- [`Negative<T, Then = T, Else = never>`](negative.ts#L21): check if `T` is a negative numeric value.
|
|
147
|
+
- [`IsNegative<T, Then = true, Else = false>`](negative.ts#L57): is `T` a negative numeric value.
|
|
148
|
+
- [`NotNegativeType<T, Then = T, Else = never>`](negative.ts#L75): check if `T` is not a negative numeric value.
|
|
149
|
+
- [`IsNotNegative<T, Then = true, Else = false>`](negative.ts#L109): is `T` not a negative numeric value.
|
|
150
|
+
|
|
151
|
+
## References
|
|
152
|
+
|
|
153
|
+
- [Handbook]
|
|
154
|
+
|
|
155
|
+
[handbook]: https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#the-primitives-string-number-and-boolean
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { IsAny } from '../any/any_type.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if the type `T` is exactly the type `number` and not numeric literals.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import type { StrictNumberType } from 'type-plus'
|
|
8
|
+
*
|
|
9
|
+
* type R = StrictNumberType<number> // true
|
|
10
|
+
* type R = StrictNumberType<1> // false
|
|
11
|
+
*
|
|
12
|
+
* type R = StrictNumberType<never> // false
|
|
13
|
+
* type R = StrictNumberType<unknown> // false
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export type StrictNumberType<T, Then = T, Else = never> = IsAny<
|
|
17
|
+
T,
|
|
18
|
+
Else,
|
|
19
|
+
[number, T] extends [T, number] ? Then : Else
|
|
20
|
+
>
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Is the type `T` exactly the type `number` and not numeric literals.
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* import type { IsStrictNumber } from 'type-plus'
|
|
27
|
+
*
|
|
28
|
+
* type R = IsStrictNumber<number> // true
|
|
29
|
+
* type R = IsStrictNumber<1> // false
|
|
30
|
+
*
|
|
31
|
+
* type R = IsStrictNumber<never> // false
|
|
32
|
+
* type R = IsStrictNumber<unknown> // false
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export type IsStrictNumber<T, Then = true, Else = false> = StrictNumberType<T, Then, Else>
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Check if the type `T` is not the type `number` or numeric literals.
|
|
39
|
+
*
|
|
40
|
+
* ```ts
|
|
41
|
+
* import type { NotStictNumberType } from 'type-plus'
|
|
42
|
+
*
|
|
43
|
+
* type R = NotStictNumberType<number> // false
|
|
44
|
+
* type R = NotStictNumberType<1> // true
|
|
45
|
+
*
|
|
46
|
+
* type R = NotStictNumberType<never> // true
|
|
47
|
+
* type R = NotStictNumberType<unknown> // true
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export type NotStrictNumberType<T, Then = T, Else = never> = StrictNumberType<T, Else, Then>
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Is the type `T` not the type `number` or numeric literals.
|
|
54
|
+
*
|
|
55
|
+
* ```ts
|
|
56
|
+
* import type { IsNotStrictNumber } from 'type-plus'
|
|
57
|
+
*
|
|
58
|
+
* type R = IsNotStrictNumber<number> // false
|
|
59
|
+
* type R = IsNotStrictNumber<1> // true
|
|
60
|
+
*
|
|
61
|
+
* type R = IsNotStrictNumber<never> // true
|
|
62
|
+
* type R = IsNotStrictNumber<unknown> // true
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export type IsNotStrictNumber<T, Then = true, Else = false> = StrictNumberType<T, Else, Then>
|
package/ts/object/ANotB.ts
CHANGED
package/ts/object/KnownKeys.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// known from Gerrit Birkeland @Gerrit0
|
|
3
3
|
// https://github.com/Microsoft/TypeScript/issues/25987#issuecomment-408339599
|
|
4
4
|
|
|
5
|
-
import type { PrimitiveTypes } from '../
|
|
5
|
+
import type { PrimitiveTypes } from '../primitive.js'
|
|
6
6
|
|
|
7
7
|
// https://github.com/microsoft/TypeScript/issues/25987#issuecomment-441224690
|
|
8
8
|
export type KnownKeys<T> = T extends PrimitiveTypes
|
package/ts/object/Partial.ts
CHANGED
package/ts/object/getField.ts
CHANGED
package/ts/object/hasProperty.ts
CHANGED
package/ts/object/index.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
export type { ANotB, BNotA, LeftJoin } from './ANotB.js'
|
|
2
2
|
export type { AnyRecord } from './AnyRecord.js'
|
|
3
|
-
export * from './everyKey.js'
|
|
4
3
|
export type { ExcludePropType } from './ExcludePropType.js'
|
|
4
|
+
export type { IsDisjoint } from './IsDisjoint.js'
|
|
5
|
+
export type { IsRecord } from './IsRecord.js'
|
|
6
|
+
export type { KeyTypes } from './KeyTypes.js'
|
|
7
|
+
export type { KeysOfOptional } from './KeyofOptional.js'
|
|
8
|
+
export type { KeysWithDiffType } from './KeysWithDiffType.js'
|
|
9
|
+
export type { KnownKeys } from './KnownKeys.js'
|
|
10
|
+
export type { OptionalKeys } from './OptionalKeys.js'
|
|
11
|
+
export type { PartialExcept, PartialOmit, PartialPick } from './Partial.js'
|
|
12
|
+
export type { RecursiveIntersect } from './RecursiveIntersect.js'
|
|
13
|
+
export type { RecursivePartial } from './RecursivePartial.js'
|
|
14
|
+
export type { RecursiveRequired } from './RecursiveRequired.js'
|
|
15
|
+
export type { RequiredExcept, RequiredPick } from './Required.js'
|
|
16
|
+
export type { RequiredKeys } from './RequiredKeys.js'
|
|
17
|
+
export type { SpreadRecord } from './SpreadRecord.js'
|
|
18
|
+
export type { ValueOf } from './ValueOf.js'
|
|
19
|
+
export * from './everyKey.js'
|
|
5
20
|
export * from './facade.js'
|
|
6
21
|
export * from './filterKey.js'
|
|
7
22
|
export * from './findKey.js'
|
|
@@ -9,28 +24,14 @@ export * from './forEachKey.js'
|
|
|
9
24
|
export * from './getField.js'
|
|
10
25
|
export * from './hasKey.js'
|
|
11
26
|
export * from './hasProperty.js'
|
|
12
|
-
export type { IsDisjoint } from './IsDisjoint.js'
|
|
13
|
-
export type { IsRecord } from './IsRecord.js'
|
|
14
|
-
export type { KeysOfOptional } from './KeyofOptional.js'
|
|
15
|
-
export type { KeysWithDiffType } from './KeysWithDiffType.js'
|
|
16
|
-
export type { KeyTypes } from './KeyTypes.js'
|
|
17
|
-
export type { KnownKeys } from './KnownKeys.js'
|
|
18
27
|
export * from './mapKey.js'
|
|
19
28
|
export * from './mapProperties.js'
|
|
20
29
|
export * from './omit.js'
|
|
21
|
-
export type { OptionalKeys } from './OptionalKeys.js'
|
|
22
|
-
export type { PartialExcept, PartialOmit, PartialPick } from './Partial.js'
|
|
23
30
|
export * from './pick.js'
|
|
31
|
+
export type { Properties } from './properties.js'
|
|
24
32
|
export * from './record.js'
|
|
25
|
-
export type { RecursiveIntersect } from './RecursiveIntersect.js'
|
|
26
|
-
export type { RecursivePartial } from './RecursivePartial.js'
|
|
27
|
-
export type { RecursiveRequired } from './RecursiveRequired.js'
|
|
28
33
|
export * from './reduceKey.js'
|
|
29
34
|
export * from './replaceProperty.js'
|
|
30
|
-
export type { RequiredExcept, RequiredPick } from './Required.js'
|
|
31
|
-
export type { RequiredKeys } from './RequiredKeys.js'
|
|
32
35
|
export * from './someKey.js'
|
|
33
36
|
export * from './split.js'
|
|
34
|
-
export type { SpreadRecord } from './SpreadRecord.js'
|
|
35
37
|
export * from './typeOverrideIncompatible.js'
|
|
36
|
-
export type { ValueOf } from './ValueOf.js'
|