type-plus 6.3.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 +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 +43 -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 +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 -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 +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 -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 +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 +24 -4
- 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 -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.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 -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/{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,65 @@
|
|
|
1
|
+
import { IsAnyOrNever } from '../any/any_or_never.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if `T` is an `object`.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { type ObjectType } from 'type-plus'
|
|
8
|
+
*
|
|
9
|
+
* type R = ObjectType<{}> // {}
|
|
10
|
+
* type R = ObjectType<{ a: 1 }> // { a: 1 }
|
|
11
|
+
* type R = ObjectType<Function> // Function
|
|
12
|
+
*
|
|
13
|
+
* type R = ObjectType<number> // never
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export type ObjectType<T, Then = T, Else = never> = IsAnyOrNever<T, Else, [T] extends [object] ? Then : Else>
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Is `T` an `object`.
|
|
20
|
+
*
|
|
21
|
+
* Note that `Function` is also an `object`.
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { type IsObject } from 'type-plus'
|
|
25
|
+
*
|
|
26
|
+
* type R = IsObject<{}> // true
|
|
27
|
+
* type R = IsObject<{ a: 1 }> // true
|
|
28
|
+
* type R = IsObject<Function> // true
|
|
29
|
+
*
|
|
30
|
+
* type R = IsObject<number> // false
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export type IsObject<T, Then = true, Else = false> = ObjectType<T, Then, Else>
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Check if `T` is not an `object`.
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { type NotObjectType } from 'type-plus'
|
|
40
|
+
*
|
|
41
|
+
* type R = NotObjectType<{}> // never
|
|
42
|
+
* type R = NotObjectType<{ a: 1 }> // never
|
|
43
|
+
* type R = NotObjectType<Function> // never
|
|
44
|
+
*
|
|
45
|
+
* type R = NotObjectType<number> // number
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export type NotObjectType<T, Then = T, Else = never> = ObjectType<T, Else, Then>
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Is `T` not an `object`.
|
|
52
|
+
*
|
|
53
|
+
* Note that `Function` is also an `object`.
|
|
54
|
+
*
|
|
55
|
+
* ```ts
|
|
56
|
+
* import { type IsNotObject } from 'type-plus'
|
|
57
|
+
*
|
|
58
|
+
* type R = IsNotObject<{}> // false
|
|
59
|
+
* type R = IsNotObject<{ a: 1 }> // false
|
|
60
|
+
* type R = IsNotObject<Function> // false
|
|
61
|
+
*
|
|
62
|
+
* type R = IsNotObject<number> // true
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export type IsNotObject<T, Then = true, Else = false> = ObjectType<T, Else, Then>
|
package/ts/object/omit.ts
CHANGED
package/ts/object/pick.ts
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# object
|
|
2
|
+
|
|
3
|
+
## Type Checking
|
|
4
|
+
|
|
5
|
+
The `ObjectType<T>` and friends are used to check if a type is `object` or object types.
|
|
6
|
+
|
|
7
|
+
Note that `Function` are also considered `object` in TypeScript.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import type { ObjectType } from 'type-plus'
|
|
11
|
+
|
|
12
|
+
type R = ObjectType<object> // object
|
|
13
|
+
type R = ObjectType<{}> // {}
|
|
14
|
+
type R = ObjectType<{ a: number }> // { a: number }
|
|
15
|
+
|
|
16
|
+
type R = ObjectType<1> // never
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- [`ObjectType<T, Then = T, Else = never>`](object_type.ts#L16): check if `T` is `object`.
|
|
20
|
+
- [`IsObject<T, Then = true, Else = false`](object_type.ts#L33): is `T` `object`.
|
|
21
|
+
- [`NotObjectType<T, Then = T, Else = never>`](object_type.ts#L48): check if `T` is not `object`.
|
|
22
|
+
- [`IsNotObject<T, Then = true, Else = false>`](object_type.ts#L65): is `T` not `object`.
|
|
23
|
+
|
|
24
|
+
## References
|
|
25
|
+
|
|
26
|
+
- [Handbook]
|
|
27
|
+
|
|
28
|
+
[handbook]: https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#object-types
|
package/ts/predicates/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './CanAssign.js'
|
|
2
|
-
export type { Equal, IsEqual, IsNotEqual, NotEqual } from './Equal.js'
|
|
3
2
|
export type { Extendable, IsExtend, IsNotExtend, NotExtendable } from './Extends.js'
|
|
4
3
|
export type { If } from './If.js'
|
|
5
4
|
export type { IsEmptyObject } from './IsEmptyObject.js'
|
|
@@ -11,5 +10,3 @@ export type IsLiteral<T extends number | string, Then = true, Else = false> = nu
|
|
|
11
10
|
: string extends T
|
|
12
11
|
? Else
|
|
13
12
|
: Then
|
|
14
|
-
|
|
15
|
-
export type IsBoolean<T, Then = true, Else = false> = boolean extends T ? Then : Else
|
package/ts/predicates/isType.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Equal } from '
|
|
1
|
+
import type { Equal } from '../equal/equal.js'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Is the subject of type T
|
|
@@ -15,6 +15,7 @@ export function isType(subject: unknown, validator?: (s: unknown) => unknown) {
|
|
|
15
15
|
isType.t = function <T extends true>(subject?: T) {
|
|
16
16
|
return subject === undefined || subject === true
|
|
17
17
|
}
|
|
18
|
+
|
|
18
19
|
isType.f = function <T extends false>(subject?: T) {
|
|
19
20
|
return subject === undefined || subject === false
|
|
20
21
|
}
|
|
@@ -37,6 +38,7 @@ isType.never = isNever
|
|
|
37
38
|
* Are types A and B equals/not equals.
|
|
38
39
|
* Easier to use than `isType.t<>()` and `isType.f<>()`,
|
|
39
40
|
* when doing type level only equality comparison as you don't have to import `Equal<>`.
|
|
41
|
+
*
|
|
42
|
+
* @deprecated use `type.equal()` instead
|
|
40
43
|
*/
|
|
41
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
42
44
|
isType.equal = function <C extends Equal<A, B>, A, B>() {}
|
package/ts/primitive.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# string
|
|
2
|
+
|
|
3
|
+
## Type Checking
|
|
4
|
+
|
|
5
|
+
The `StringType<T>` and friends are used to check if a type is `string` or string literals.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import type { StringType } from 'type-plus'
|
|
9
|
+
|
|
10
|
+
type R = StringType<string> // string
|
|
11
|
+
type R = StringType<'a'> // 'a'
|
|
12
|
+
|
|
13
|
+
type R = StringType<1> // never
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- [`StringType<T, Then = T, Else = never>`](string_type.ts#L18): check if `T` is `string`.
|
|
17
|
+
- [`IsString<T, Then = true, Else = false`](string_type.ts#L35): is `T` `string`.
|
|
18
|
+
- [`NotStringType<T, Then = T, Else = never>`](string_type.ts#L52): check if `T` is not `string`.
|
|
19
|
+
- [`IsNotString<T, Then = true, Else = false>`](string_type.ts#L69): is `T` not `string`.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
The `StrictStringType<T>` and friends are used to check if a type is exactly `string` type.
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import type { StrictStringType } from 'type-plus'
|
|
27
|
+
|
|
28
|
+
type R = StrictStringType<string> // string
|
|
29
|
+
|
|
30
|
+
type R = StrictStringType<'a'> // never
|
|
31
|
+
type R = StrictStringType<1> // never
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- [`StrictStringType<T, Then = T, Else = never>`](strict_string_type.ts#L18): check if `T` is exactly `string`.
|
|
35
|
+
- [`IsStrictString<T, Then = true, Else = false`](strict_string_type.ts#L35): is `T` exactly `string`.
|
|
36
|
+
- [`NotStrictStringType<T, Then = T, Else = never>`](strict_string_type.ts#L52): check if `T` is not exactly `string`.
|
|
37
|
+
- [`IsNotStrictString<T, Then = true, Else = false>`](strict_string_type.ts#L69): is `T` not exactly `string`.
|
|
38
|
+
|
|
39
|
+
## References
|
|
40
|
+
|
|
41
|
+
- [Handbook]
|
|
42
|
+
|
|
43
|
+
[handbook]: https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#the-primitives-string-number-and-boolean
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { IsAny } from '../any/any_type.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if the type `T` is exactly `string`.
|
|
5
|
+
*
|
|
6
|
+
* ```
|
|
7
|
+
* import type { StrictStringType } from 'type-plus'
|
|
8
|
+
*
|
|
9
|
+
* type R = StrictStringType<string> // string
|
|
10
|
+
*
|
|
11
|
+
* type R = StrictStringType<''> // never
|
|
12
|
+
* type R = StrictStringType<'1'> // never
|
|
13
|
+
* type R = StrictStringType<string | boolean> // never
|
|
14
|
+
* type R = StrictStringType<never> // never
|
|
15
|
+
* type R = StrictStringType<unknown> // never
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export type StrictStringType<T, Then = T, Else = never> = IsAny<T, Else, [T, string] extends [string, T] ? Then : Else>
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Is the type `T` exactly `string`.
|
|
22
|
+
*
|
|
23
|
+
* ```
|
|
24
|
+
* import type { IsStrictString } from 'type-plus'
|
|
25
|
+
*
|
|
26
|
+
* type R = IsStrictString<string> // true
|
|
27
|
+
*
|
|
28
|
+
* type R = IsStrictString<''> // false
|
|
29
|
+
* type R = IsStrictString<'a'> // false
|
|
30
|
+
* type R = IsStrictString<string | boolean> // false
|
|
31
|
+
* type R = IsStrictString<never> // false
|
|
32
|
+
* type R = IsStrictString<unknown> // false
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export type IsStrictString<T, Then = true, Else = false> = StrictStringType<T, Then, Else>
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Check if the type `T` is not exactly `string`.
|
|
39
|
+
*
|
|
40
|
+
* ```
|
|
41
|
+
* import type { NotStrictStringType } from 'type-plus'
|
|
42
|
+
*
|
|
43
|
+
* type R = NotStrictStringType<string> // never
|
|
44
|
+
*
|
|
45
|
+
* type R = NotStrictStringType<''> // ''
|
|
46
|
+
* type R = NotStrictStringType<'a'> // 'a'
|
|
47
|
+
* type R = NotStrictStringType<string | boolean> // string | boolean
|
|
48
|
+
* type R = NotStrictStringType<never> // never
|
|
49
|
+
* type R = NotStrictStringType<unknown> // unknown
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export type NotStrictStringType<T, Then = T, Else = never> = StrictStringType<T, Else, Then>
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Is the type `T` not exactly `string`.
|
|
56
|
+
*
|
|
57
|
+
* ```
|
|
58
|
+
* import type { IsNotStrictString } from 'type-plus'
|
|
59
|
+
*
|
|
60
|
+
* type R = IsNotStrictString<string> // false
|
|
61
|
+
*
|
|
62
|
+
* type R = IsNotStrictString<''> // true
|
|
63
|
+
* type R = IsNotStrictString<'a'> // true
|
|
64
|
+
* type R = IsNotStrictString<string | boolean> // true
|
|
65
|
+
* type R = IsNotStrictString<never> // true
|
|
66
|
+
* type R = IsNotStrictString<unknown> // true
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export type IsNotStrictString<T, Then = true, Else = false> = StrictStringType<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 `string` or string literals.
|
|
5
|
+
*
|
|
6
|
+
* ```
|
|
7
|
+
* import type { StringType } from 'type-plus'
|
|
8
|
+
*
|
|
9
|
+
* type R = StringType<string> // string
|
|
10
|
+
* type R = StringType<''> // ''
|
|
11
|
+
* type R = StringType<'1'> // '1'
|
|
12
|
+
*
|
|
13
|
+
* type R = StringType<string | boolean> // never
|
|
14
|
+
* type R = StringType<never> // never
|
|
15
|
+
* type R = StringType<unknown> // never
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export type StringType<T, Then = T, Else = never> = IsAnyOrNever<T, Else, [T] extends [string] ? Then : Else>
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Is the type `T` `string` or string literals.
|
|
22
|
+
*
|
|
23
|
+
* ```
|
|
24
|
+
* import type { IsString } from 'type-plus'
|
|
25
|
+
*
|
|
26
|
+
* type R = IsString<string> // true
|
|
27
|
+
* type R = IsString<''> // true
|
|
28
|
+
* type R = IsString<'a'> // true
|
|
29
|
+
*
|
|
30
|
+
* type R = IsString<string | boolean> // false
|
|
31
|
+
* type R = IsString<never> // false
|
|
32
|
+
* type R = IsString<unknown> // false
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export type IsString<T, Then = true, Else = false> = StringType<T, Then, Else>
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Check if the type `T` is not `string` nor string literals.
|
|
39
|
+
*
|
|
40
|
+
* ```
|
|
41
|
+
* import type { NotStringType } from 'type-plus'
|
|
42
|
+
*
|
|
43
|
+
* type R = NotStringType<string> // never
|
|
44
|
+
* type R = NotStringType<''> // ''
|
|
45
|
+
* type R = NotStringType<'a'> // 'a'
|
|
46
|
+
*
|
|
47
|
+
* type R = NotStringType<string | boolean> // string | boolean
|
|
48
|
+
* type R = NotStringType<never> // never
|
|
49
|
+
* type R = NotStringType<unknown> // unknown
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export type NotStringType<T, Then = T, Else = never> = StringType<T, Else, Then>
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Is the type `T` not `string` nor string literals.
|
|
56
|
+
*
|
|
57
|
+
* ```
|
|
58
|
+
* import type { IsNotString } from 'type-plus'
|
|
59
|
+
*
|
|
60
|
+
* type R = IsNotString<string> // false
|
|
61
|
+
* type R = IsNotString<''> // false
|
|
62
|
+
* type R = IsNotString<'a'> // false
|
|
63
|
+
*
|
|
64
|
+
* type R = IsNotString<string | boolean> // true
|
|
65
|
+
* type R = IsNotString<never> // true
|
|
66
|
+
* type R = IsNotString<unknown> // true
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export type IsNotString<T, Then = true, Else = false> = StringType<T, Else, Then>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# symbol
|
|
2
|
+
|
|
3
|
+
`symbol` is a primitive type of `Symbol` in TypeScript.
|
|
4
|
+
|
|
5
|
+
## Type Checking
|
|
6
|
+
|
|
7
|
+
The `SymbolType<T>` and friends are used to check if a type is a `symbol` or not.
|
|
8
|
+
|
|
9
|
+
Note that when creating a `Symbol`, the type of the `Symbol` is `unique symbol` and not `symbol`.
|
|
10
|
+
|
|
11
|
+
There is no way to declare a `unique symbol` type in TypeScript, so `SymbolType` can only check if a type is `symbol` and treat `unique symbol` the same way.
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import type { SymbolType } from 'type-plus'
|
|
15
|
+
|
|
16
|
+
type R = SymbolType<symbol> // symbol
|
|
17
|
+
|
|
18
|
+
const s = Symbol() // unique symbol
|
|
19
|
+
type R = SymbolType<typeof s> // unique symbol
|
|
20
|
+
type.equal<R, symbol>(true) // true
|
|
21
|
+
|
|
22
|
+
type R = SymbolType<1> // never
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- [`SymbolType<T, Then = T, Else = never>`](symbol_type.ts#L16): check if `T` is `symbol`.
|
|
26
|
+
- [`IsSymbol<T, Then = true, Else = false`](symbol_type.ts#L35): is `T` `symbol`.
|
|
27
|
+
- [`NotSymbolType<T, Then = T, Else = never>`](symbol_type.ts#L50): check if `T` is not `symbol`.
|
|
28
|
+
- [`IsNotSymbol<T, Then = true, Else = false>`](symbol_type.ts#L65): is `T` not `symbol`.
|
|
29
|
+
|
|
30
|
+
## References
|
|
31
|
+
|
|
32
|
+
- [Handbook]
|
|
33
|
+
|
|
34
|
+
[handbook]: https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#symbol
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { IsAnyOrNever } from '../any/any_or_never.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if the type `T` is exactly `symbol`.
|
|
5
|
+
*
|
|
6
|
+
* ```
|
|
7
|
+
* import type { SymbolType } from 'type-plus'
|
|
8
|
+
*
|
|
9
|
+
* type R = SymbolType<symbol> // symbol
|
|
10
|
+
*
|
|
11
|
+
* type R = SymbolType<never> // never
|
|
12
|
+
* type R = SymbolType<unknown> // never
|
|
13
|
+
* type R = SymbolType<symbol | boolean> // never
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export type SymbolType<T, Then = T, Else = never> = IsAnyOrNever<
|
|
17
|
+
T,
|
|
18
|
+
Else,
|
|
19
|
+
[T] extends [symbol] ? Then : Else
|
|
20
|
+
>
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Is the type `T` exactly `symbol`.
|
|
24
|
+
*
|
|
25
|
+
* ```
|
|
26
|
+
* import type { IsSymbol } from 'type-plus'
|
|
27
|
+
*
|
|
28
|
+
* type R = IsSymbol<symbol> // true
|
|
29
|
+
*
|
|
30
|
+
* type R = IsSymbol<never> // false
|
|
31
|
+
* type R = IsSymbol<unknown> // false
|
|
32
|
+
* type R = IsSymbol<symbol | boolean> // false
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export type IsSymbol<T, Then = true, Else = false> = SymbolType<T, Then, Else>
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Check if the type `T` is not `symbol`.
|
|
39
|
+
*
|
|
40
|
+
* ```
|
|
41
|
+
* import type { NotSymbolType } from 'type-plus'
|
|
42
|
+
*
|
|
43
|
+
* type R = NotSymbolType<symbol> // never
|
|
44
|
+
*
|
|
45
|
+
* type R = NotSymbolType<never> // never
|
|
46
|
+
* type R = NotSymbolType<unknown> // unknown
|
|
47
|
+
* type R = NotSymbolType<symbol | boolean> // symbol | boolean
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export type NotSymbolType<T, Then = T, Else = never> = SymbolType<T, Else, Then>
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Is the type `T` not `symbol`.
|
|
54
|
+
*
|
|
55
|
+
* ```
|
|
56
|
+
* import type { IsNotSymbol } from 'type-plus'
|
|
57
|
+
*
|
|
58
|
+
* type R = IsNotSymbol<symbol> // false
|
|
59
|
+
*
|
|
60
|
+
* type R = IsNotSymbol<never> // true
|
|
61
|
+
* type R = IsNotSymbol<unknown> // true
|
|
62
|
+
* type R = IsNotSymbol<symbol | boolean> // true
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export type IsNotSymbol<T, Then = true, Else = false> = SymbolType<T, Else, Then>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# testing
|
|
2
|
+
|
|
3
|
+
This folder contains utilities for testing.
|
|
4
|
+
|
|
5
|
+
## `testType`
|
|
6
|
+
|
|
7
|
+
`testType` is a test utilities for types.
|
|
8
|
+
|
|
9
|
+
This is designed specifically for testing.
|
|
10
|
+
The return value is the input `expected` parameter asserted as the first type parameter,
|
|
11
|
+
so that the type can be further inspected.
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { testType } from 'type-plus'
|
|
15
|
+
|
|
16
|
+
testType.any<T>(true) // T is `any`
|
|
17
|
+
testType.equal<A, B>(true) // A is equal to B
|
|
18
|
+
testType.never<T>(false) // T is not `never`
|
|
19
|
+
```
|
package/ts/testing/stub.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { requiredDeep } from 'unpartial'
|
|
2
|
-
import type { AnyFunction } from '../function/
|
|
3
|
-
import type { RecursivePartial } from '../object/
|
|
2
|
+
import type { AnyFunction } from '../function/any_function.js'
|
|
3
|
+
import type { RecursivePartial } from '../object/RecursivePartial.js'
|
|
4
4
|
|
|
5
5
|
export namespace stub {
|
|
6
6
|
export type Param<T> = T extends AnyFunction ? T : RecursivePartial<T>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { IsAny } from '../any/any_type.js'
|
|
2
|
+
import type { IsBoolean } from '../boolean/boolean_type.js'
|
|
3
|
+
import type { IsFalse } from '../boolean/false_type.js'
|
|
4
|
+
import type { IsStrictBoolean } from '../boolean/strict_boolean_type.js'
|
|
5
|
+
import type { IsTrue } from '../boolean/true_type.js'
|
|
6
|
+
import type { Equal } from '../equal/equal.js'
|
|
7
|
+
import type { IsNever } from '../never/never_type.js'
|
|
8
|
+
import { IsNumber } from '../number/number_type.js'
|
|
9
|
+
import type { IsStrictNumber } from '../number/strict_number_type.js'
|
|
10
|
+
import type { CanAssign } from '../predicates/CanAssign.js'
|
|
11
|
+
import type { IsUnknown } from '../unknown/unknown_type.js'
|
|
12
|
+
import type { IsVoid } from '../void/void_type.js'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Check if type `A` is equal to type `B` and `C`.
|
|
16
|
+
*
|
|
17
|
+
* @return `expected` as `A` for type inspection.
|
|
18
|
+
*/
|
|
19
|
+
function equal<A, B, C>(expected: Equal<A, B> & Equal<A, C>): A
|
|
20
|
+
/**
|
|
21
|
+
* Check if type `A` is equal to type `B`.
|
|
22
|
+
*
|
|
23
|
+
* @return `expected` as `A` for type inspection.
|
|
24
|
+
*/
|
|
25
|
+
function equal<A, B>(expected: Equal<A, B>): A
|
|
26
|
+
function equal(expected: unknown) {
|
|
27
|
+
return expected
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Test utilities for types.
|
|
32
|
+
*
|
|
33
|
+
* This is designed specifically for testing.
|
|
34
|
+
* The return value is the input `expected` parameter asserted as the first type parameter,
|
|
35
|
+
* so that the type can be further inspected.
|
|
36
|
+
*/
|
|
37
|
+
export const testType = {
|
|
38
|
+
/**
|
|
39
|
+
* Check if type `T` is exactly `any`.
|
|
40
|
+
*
|
|
41
|
+
* @return `expected` as `T` for type inspection.
|
|
42
|
+
*/
|
|
43
|
+
any<T>(expected: IsAny<T>) {
|
|
44
|
+
return expected as T
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* Check if type `T` is exactly `unknown`.
|
|
48
|
+
*
|
|
49
|
+
* @return `expected` as `T` for type inspection.
|
|
50
|
+
*/
|
|
51
|
+
unknown<T>(expected: IsUnknown<T>) {
|
|
52
|
+
return expected as T
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Check if type `T` is exactly `never`.
|
|
56
|
+
*
|
|
57
|
+
* @return `expected` as `T` for type inspection.
|
|
58
|
+
*/
|
|
59
|
+
never<T>(expected: IsNever<T>) {
|
|
60
|
+
return expected as T
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* Check if type `T` is exactly `void`.
|
|
64
|
+
*
|
|
65
|
+
* @return `expected` as `T` for type inspection.
|
|
66
|
+
*/
|
|
67
|
+
void<T>(expected: IsVoid<T>) {
|
|
68
|
+
return expected as T
|
|
69
|
+
},
|
|
70
|
+
equal,
|
|
71
|
+
/**
|
|
72
|
+
* Check if `A` can assign to `B`.
|
|
73
|
+
*
|
|
74
|
+
* @return `expected` as `A` for type inspection.
|
|
75
|
+
*/
|
|
76
|
+
canAssign<A, B>(expected: CanAssign<A, B>) {
|
|
77
|
+
return expected as A
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* Check if type `T` is exactly `boolean`.
|
|
81
|
+
*
|
|
82
|
+
* @return `expected` as `T` for type inspection.
|
|
83
|
+
*/
|
|
84
|
+
strictBoolean<T>(expected: IsStrictBoolean<T>) {
|
|
85
|
+
return expected as T
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* Check if type `T` is `boolean` and boolean literals.
|
|
89
|
+
*
|
|
90
|
+
* @return `expected` as `T` for type inspection.
|
|
91
|
+
*/
|
|
92
|
+
boolean<T>(expected: IsBoolean<T>) {
|
|
93
|
+
return expected as T
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* Check if type `T` is exactly `true`.
|
|
97
|
+
*
|
|
98
|
+
* @return `expected` as `T` for type inspection.
|
|
99
|
+
*/
|
|
100
|
+
true<T>(expected: IsTrue<T>) {
|
|
101
|
+
return expected as T
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* Check if type `T` is exactly `false`.
|
|
105
|
+
*
|
|
106
|
+
* @return `expected` as `T` for type inspection.
|
|
107
|
+
*/
|
|
108
|
+
false<T>(expected: IsFalse<T>) {
|
|
109
|
+
return expected as T
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* Check if type `T` is exactly `number`.
|
|
113
|
+
*
|
|
114
|
+
* @return `expected` as `T` for type inspection.
|
|
115
|
+
*/
|
|
116
|
+
strictNumber<T>(expected: IsStrictNumber<T>) {
|
|
117
|
+
return expected as T
|
|
118
|
+
},
|
|
119
|
+
/**
|
|
120
|
+
* Check if type `T` is `number` or number literals.
|
|
121
|
+
*
|
|
122
|
+
* @return `expected` as `T` for type inspection.
|
|
123
|
+
*/
|
|
124
|
+
number<T>(expected: IsNumber<T>) {
|
|
125
|
+
return expected as T
|
|
126
|
+
}
|
|
127
|
+
}
|
package/ts/tuple/readme.md
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
|
-
#
|
|
1
|
+
# unknown
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`unknown` is one of the top type in TypeScript.
|
|
4
|
+
It is a "safer" variant of `any` that you cannot use the value until there are some type guards or type assertions to the value.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
## Type Checking
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
The `TupleType<T>` and friends are used to check if `T` is a tuple, excluding array.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import type { TupleType } from 'type-plus'
|
|
12
|
+
|
|
13
|
+
type R = TupleType<unknown> // unknown
|
|
14
|
+
|
|
15
|
+
type R = TupleType<1> // never
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- [`TupleType<T, Then = T, Else = never>`](unknown_type.ts#L16): check if `T` is `unknown`.
|
|
19
|
+
- [`IsUnknown<T, Then = true, Else = false`](unknown_type.ts#L35): is `T` `unknown`.
|
|
20
|
+
- [`NotUnknownType<T, Then = T, Else = never>`](unknown_type.ts#L50): check if `T` is not `unknown`.
|
|
21
|
+
- [`IsNotUnknown<T, Then = true, Else = false>`](unknown_type.ts#L65): is `T` not `unknown`.
|
|
22
|
+
|
|
23
|
+
## References
|
|
24
|
+
|
|
25
|
+
- [Handbook]
|
|
26
|
+
|
|
27
|
+
[handbook]: https://www.typescriptlang.org/docs/handbook/2/functions.html#unknown
|