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
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Widen } from '../utils/index.js';
|
|
2
|
-
import { typeSym } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Create a "flavored" version of a type.
|
|
5
|
-
* TypeScript will disallow mixing flavors,
|
|
6
|
-
* but will allow unflavored values of that type to be passed in where a flavored version is expected.
|
|
7
|
-
* This is a less restrictive form of branding.
|
|
8
|
-
*/
|
|
9
|
-
export type Flavor<F extends string, T> = T & {
|
|
10
|
-
[typeSym]?: F;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Creates a brand creator with the specified type.
|
|
14
|
-
*/
|
|
15
|
-
export declare function flavor<F extends string>(type: F): <T>(subject: T) => Flavor<F, Widen<T>>;
|
|
16
|
-
/**
|
|
17
|
-
* Creates a branded value of specified type.
|
|
18
|
-
*/
|
|
19
|
-
export declare function flavor<F extends string, T>(type: F, subject: T): Flavor<F, Widen<T>>;
|
|
20
|
-
//# sourceMappingURL=Flavor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Flavor.d.ts","sourceRoot":"","sources":["../../ts/nominal-types/Flavor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC;;;;;GAKG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG;IAC7C,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAA;CACb,CAAA;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AACzF;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// By Drew Colthorp, <https://spin.atomicobject.com/2018/01/15/typescript-flexible-nominal-typing/#comment-604580>
|
|
2
|
-
// <https://gist.github.com/dcolthorp/aa21cf87d847ae9942106435bf47565d>
|
|
3
|
-
import { typeSym } from './types.js';
|
|
4
|
-
export function flavor(type, subject) {
|
|
5
|
-
if (subject === undefined)
|
|
6
|
-
return function (subject) {
|
|
7
|
-
return flavor(type, subject);
|
|
8
|
-
};
|
|
9
|
-
if (typeof subject === 'object' && subject !== null) {
|
|
10
|
-
// if subject is not an object, the branding will exist only in type-level.
|
|
11
|
-
;
|
|
12
|
-
subject[typeSym] = type;
|
|
13
|
-
}
|
|
14
|
-
return subject;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=Flavor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Flavor.js","sourceRoot":"","sources":["../../ts/nominal-types/Flavor.ts"],"names":[],"mappings":"AAAA,kHAAkH;AAClH,uEAAuE;AAGvE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAoBpC,MAAM,UAAU,MAAM,CAAC,IAAY,EAAE,OAAiB;IACrD,IAAI,OAAO,KAAK,SAAS;QACxB,OAAO,UAAa,OAAU;YAC7B,OAAO,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAC7B,CAAC,CAAA;IACF,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE;QACpD,2EAA2E;QAC3E,CAAC;QAAC,OAAiC,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;KACnD;IACD,OAAO,OAAO,CAAA;AACf,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../ts/nominal-types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/nominal-types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Brand } from './Brand.js';
|
|
2
|
-
import type { Flavor } from './Flavor.js';
|
|
3
|
-
export declare function nominalMatch<A extends string, B extends A>(a: Brand<A, unknown>, b: Brand<B, unknown>): boolean;
|
|
4
|
-
export declare function nominalMatch<A extends string, B extends A>(a: Flavor<A, unknown>, b: Flavor<B, unknown>): boolean;
|
|
5
|
-
//# sourceMappingURL=nominalMatch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nominalMatch.d.ts","sourceRoot":"","sources":["../../ts/nominal-types/nominalMatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,CAAC,EACzD,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,EACpB,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,GAClB,OAAO,CAAA;AACV,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,CAAC,EACzD,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,EACrB,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,GACnB,OAAO,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { typeSym } from './types.js';
|
|
2
|
-
export function nominalMatch(a, b) {
|
|
3
|
-
if (typeof a === 'object' && a !== null && typeof b === 'object' && b !== null)
|
|
4
|
-
return a[typeSym] === b[typeSym];
|
|
5
|
-
else {
|
|
6
|
-
return true;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=nominalMatch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nominalMatch.js","sourceRoot":"","sources":["../../ts/nominal-types/nominalMatch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAUpC,MAAM,UAAU,YAAY,CAC3B,CAAyC,EACzC,CAAyC;IAEzC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI;QAC7E,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAA;SAC5B;QACJ,OAAO,IAAI,CAAA;KACX;AACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../ts/nominal-types/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,eAAiB,CAAA;AACrC,eAAO,MAAM,QAAQ,eAAkB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../ts/nominal-types/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;AACrC,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../ts/number_plus/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,aAAa,CAAA"}
|
package/esm/number_plus/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/number_plus/index.ts"],"names":[],"mappings":""}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import type { IsNever } from '../PrimitiveTypes.js';
|
|
2
|
-
import type { IsAny } from '../any_plus/any.js';
|
|
3
|
-
/**
|
|
4
|
-
* Either number or bigint.
|
|
5
|
-
*/
|
|
6
|
-
export type Numeric = number | bigint;
|
|
7
|
-
/**
|
|
8
|
-
* The value 0 in number or bigint.
|
|
9
|
-
*/
|
|
10
|
-
export type Zero = 0 | 0n;
|
|
11
|
-
/**
|
|
12
|
-
* Check if the value is an integer.
|
|
13
|
-
*
|
|
14
|
-
* ```
|
|
15
|
-
* import type { Integer } from 'type-plus'
|
|
16
|
-
*
|
|
17
|
-
* type R = Integer<0> // 0
|
|
18
|
-
* type R = Integer<1.1> // never
|
|
19
|
-
* type R = Integer<number> // never as it contains non-integer
|
|
20
|
-
*
|
|
21
|
-
* type R = Integer<0, true, false> // true
|
|
22
|
-
* type R = Integer<1.1, true, false> // false
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export type Integer<N extends Numeric, Then = N, Else = never> = IsNever<N, Else, `${N}` extends `${bigint}` ? Then : Else>;
|
|
26
|
-
/**
|
|
27
|
-
* Check if the value is an integer.
|
|
28
|
-
*
|
|
29
|
-
* ```
|
|
30
|
-
* import type { IsInteger } from 'type-plus'
|
|
31
|
-
*
|
|
32
|
-
* type R = IsInteger<0> // 0
|
|
33
|
-
* type R = IsInteger<1.1> // never
|
|
34
|
-
* type R = IsInteger<number> // never as it contains non-integer
|
|
35
|
-
*
|
|
36
|
-
* type R = IsInteger<0, true, false> // true
|
|
37
|
-
* type R = IsInteger<1.1, true, false> // false
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
export type IsInteger<N extends Numeric, Then = true, Else = false> = Integer<N, Then, Else>;
|
|
41
|
-
/**
|
|
42
|
-
* Check if the value is an integer.
|
|
43
|
-
*
|
|
44
|
-
* ```
|
|
45
|
-
* import type { IsWhole } from 'type-plus'
|
|
46
|
-
*
|
|
47
|
-
* type R = IsWhole<0> // 0
|
|
48
|
-
* type R = IsWhole<1.1> // never
|
|
49
|
-
* type R = IsWhole<number> // never as it contains non-integer
|
|
50
|
-
*
|
|
51
|
-
* type R = IsWhole<0, true, false> // true
|
|
52
|
-
* type R = IsWhole<1.1, true, false> // false
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
export type IsWhole<N extends Numeric, Then = true, Else = false> = Integer<N, Then, Else>;
|
|
56
|
-
/**
|
|
57
|
-
* Check if the value is a negative number.
|
|
58
|
-
*
|
|
59
|
-
* ```
|
|
60
|
-
* import type { Negative } from 'type-plus'
|
|
61
|
-
*
|
|
62
|
-
* type R = Negative<-1> // -1
|
|
63
|
-
* type R = Negative<0> // never
|
|
64
|
-
*
|
|
65
|
-
* type R = Negative<-1, true, false> // true
|
|
66
|
-
* type R = Negative<1, true, false> // false
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
export type Negative<N extends Numeric, Then = N, Else = never> = IsNever<N, Else, N extends Zero ? Else : `${N}` extends `-${string}` ? Then : Else>;
|
|
70
|
-
/**
|
|
71
|
-
* Check if the value it not a negative number.
|
|
72
|
-
*
|
|
73
|
-
* ```
|
|
74
|
-
* import type { NonNegative } from 'type-plus'
|
|
75
|
-
*
|
|
76
|
-
* type R = NonNegative<-1> // never
|
|
77
|
-
* type R = NonNegative<0> // 0
|
|
78
|
-
*
|
|
79
|
-
* type R = NonNegative<-1, true, false> // false
|
|
80
|
-
* type R = NonNegative<1, true, false> // true
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
export type NonNegative<N extends Numeric, Then = N, Else = never> = Negative<N, Else, Then>;
|
|
84
|
-
/**
|
|
85
|
-
* Check if the type `T` is exactly the type `number` and not numeric literals.
|
|
86
|
-
*
|
|
87
|
-
* ```
|
|
88
|
-
* import type { NumberType } from 'type-plus'
|
|
89
|
-
*
|
|
90
|
-
* type R = NumberType<number> // true
|
|
91
|
-
* type R = NumberType<1> // false
|
|
92
|
-
* ```
|
|
93
|
-
*/
|
|
94
|
-
export type NumberType<T, Then = T, Else = never> = IsAny<T, Else, [
|
|
95
|
-
number,
|
|
96
|
-
T
|
|
97
|
-
] extends [T, number] ? Then : Else>;
|
|
98
|
-
/**
|
|
99
|
-
* Check if the value is a positive number.
|
|
100
|
-
*
|
|
101
|
-
* ```
|
|
102
|
-
* import type { Positive } from 'type-plus'
|
|
103
|
-
*
|
|
104
|
-
* type R = Positive<1> // 1
|
|
105
|
-
* type R = Positive<0> // never
|
|
106
|
-
* type R = Positive<-1> // never
|
|
107
|
-
*
|
|
108
|
-
* type R = Positive<1, true, false> // true
|
|
109
|
-
* type R = Positive<-1, true, false> // false
|
|
110
|
-
* ```
|
|
111
|
-
*/
|
|
112
|
-
export type Positive<N extends Numeric, Then = N, Else = never> = IsNever<N, Else, number extends N ? Else : N extends Zero ? Then : `${N}` extends `-${string}` ? Else : Then>;
|
|
113
|
-
/**
|
|
114
|
-
* Is the value `N` a positive number.
|
|
115
|
-
*
|
|
116
|
-
* ```
|
|
117
|
-
* import type { IsPositive } from 'type-plus'
|
|
118
|
-
*
|
|
119
|
-
* type R = IsPositive<1> // true
|
|
120
|
-
* type R = IsPositive<0> // false
|
|
121
|
-
* type R = IsPositive<-1> // false
|
|
122
|
-
*
|
|
123
|
-
* type R = IsPositive<1, 'good', 'bad'> // 'good'
|
|
124
|
-
* type R = IsPositive<-1, 'good', 'bad> // 'bad'
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
127
|
-
export type IsPositive<N extends Numeric, Then = true, Else = false> = Positive<N, Then, Else>;
|
|
128
|
-
//# sourceMappingURL=number.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../ts/number_plus/number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE/C;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAErC;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,CAAA;AAEzB;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,OAAO,CACvE,CAAC,EACD,IAAI,EACJ,GAAG,CAAC,EAAE,SAAS,GAAG,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI,CACxC,CAAA;AACD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAE5F;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAE1F;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,OAAO,CACxE,CAAC,EACD,IAAI,EACJ,CAAC,SAAS,IAAI,GAAG,IAAI,GAAG,GAAG,CAAC,EAAE,SAAS,IAAI,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI,CACjE,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAE5F;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,KAAK,CACxD,CAAC,EACD,IAAI,EACJ;IAAC,MAAM;IAAE,CAAC;CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAC7C,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,OAAO,CACxE,CAAC,EACD,IAAI,EACJ,MAAM,SAAS,CAAC,GAAG,IAAI,GAAG,CAAC,SAAS,IAAI,GAAG,IAAI,GAAG,GAAG,CAAC,EAAE,SAAS,IAAI,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI,CAC3F,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number.js","sourceRoot":"","sources":["../../ts/number_plus/number.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number_plus.d.ts","sourceRoot":"","sources":["../../ts/number_plus/number_plus.ts"],"names":[],"mappings":"AAAA,mBAAmB,aAAa,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number_plus.js","sourceRoot":"","sources":["../../ts/number_plus/number_plus.ts"],"names":[],"mappings":""}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { IsAny } from '../any_plus/any.js';
|
|
2
|
-
import type { And, Or } from './logical.js';
|
|
3
|
-
/**
|
|
4
|
-
* Checks if the two types are equal.
|
|
5
|
-
*/
|
|
6
|
-
export type Equal<A, B, Then = true, Else = false> = [A, B] extends [B, A] ? And<IsAny<A>, IsAny<B>, Then, Or<IsAny<A>, IsAny<B>, Else, Then>> : Else;
|
|
7
|
-
/**
|
|
8
|
-
* Checks if the two types are equal.
|
|
9
|
-
*/
|
|
10
|
-
export type IsEqual<A, B, Then = true, Else = false> = Equal<A, B, Then, Else>;
|
|
11
|
-
/**
|
|
12
|
-
* Check if the two types are not equal
|
|
13
|
-
*/
|
|
14
|
-
export type NotEqual<A, B, Then = true, Else = false> = Equal<A, B, Else, Then>;
|
|
15
|
-
/**
|
|
16
|
-
* Check if the two types are not equal
|
|
17
|
-
*/
|
|
18
|
-
export type IsNotEqual<A, B, Then = true, Else = false> = NotEqual<A, B, Then, Else>;
|
|
19
|
-
//# sourceMappingURL=Equal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Equal.d.ts","sourceRoot":"","sources":["../../ts/predicates/Equal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAE3C;;GAEG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GACvE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,GACjE,IAAI,CAAA;AAEP;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAE9E;;GAEG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAE/E;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA"}
|
package/esm/predicates/Equal.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Equal.js","sourceRoot":"","sources":["../../ts/predicates/Equal.ts"],"names":[],"mappings":""}
|
package/esm/testing/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../ts/testing/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"}
|
package/esm/testing/index.js
DELETED
package/esm/testing/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/testing/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"}
|
package/ts/ComposableTypes.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Types that can contain custom properties.
|
|
3
|
-
*/
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
5
|
-
export type ComposableTypes = object | Function
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Types that cannot contain custom properties.
|
|
9
|
-
*/
|
|
10
|
-
export type NonComposableTypes = boolean | number | string | symbol | bigint | undefined | null
|
package/ts/PrimitiveTypes.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// IsNever from @jack-williams: https://github.com/microsoft/TypeScript/issues/23182#issuecomment-379091887
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
4
|
-
export type PrimitiveTypes =
|
|
5
|
-
| boolean
|
|
6
|
-
| number
|
|
7
|
-
| string
|
|
8
|
-
| object
|
|
9
|
-
| symbol
|
|
10
|
-
| bigint
|
|
11
|
-
| Function
|
|
12
|
-
| undefined
|
|
13
|
-
| null
|
|
14
|
-
|
|
15
|
-
export type IsNever<T, Then = true, Else = false> = [T] extends [never] ? Then : Else
|
package/ts/any_plus/any.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Is the type `T` exactly `any`.
|
|
3
|
-
*
|
|
4
|
-
* ```
|
|
5
|
-
* import type { IsAny } from 'type-plus'
|
|
6
|
-
*
|
|
7
|
-
* type R = IsAny<any> // true
|
|
8
|
-
*
|
|
9
|
-
* type R = IsAny<never> // false
|
|
10
|
-
* type R = IsAny<unknown> // false
|
|
11
|
-
* type R = IsAny<string | boolean> // false
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export type IsAny<T, Then = true, Else = false> = 0 extends 1 & T ? Then : Else
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Check if the type `T` is exactly `any`.
|
|
18
|
-
*
|
|
19
|
-
* ```
|
|
20
|
-
* import type { AnyType } from 'type-plus'
|
|
21
|
-
*
|
|
22
|
-
* type R = AnyType<any> // any
|
|
23
|
-
*
|
|
24
|
-
* type R = AnyType<never> // never
|
|
25
|
-
* type R = AnyType<unknown> // never
|
|
26
|
-
* type R = AnyType<string | boolean> // never
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export type AnyType<T, Then = T, Else = never> = IsAny<T, Then, Else>
|
package/ts/any_plus/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from './any.js'
|
package/ts/array_plus/array.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { NumberType } from '../number_plus/number.js'
|
|
2
|
-
import type { IndexAt } from './array_plus.js'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Gets the type of the array or tuple at index `N`.
|
|
6
|
-
*
|
|
7
|
-
* Like `Array.at()`, this type supports negative numbers.
|
|
8
|
-
*
|
|
9
|
-
* @alias ArrayPlus.At
|
|
10
|
-
*
|
|
11
|
-
* ```
|
|
12
|
-
* import type { At } from 'type-plus'
|
|
13
|
-
*
|
|
14
|
-
* type R = At<[1, 2, 3], 2> // 3
|
|
15
|
-
* type R = At<[1, 2, 3], -1> // 3
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export type At<A extends Array<unknown>, N extends number, Fail = never> = IndexAt<A, N, Fail> extends infer I
|
|
19
|
-
? I extends number
|
|
20
|
-
? A[I]
|
|
21
|
-
: Fail
|
|
22
|
-
: never
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Concats two arrays.
|
|
26
|
-
*
|
|
27
|
-
* alias of: `[...A, ...B]`
|
|
28
|
-
*
|
|
29
|
-
* @alias ArrayPlus.Concat
|
|
30
|
-
* ```
|
|
31
|
-
* import type { Concat } form 'type-plus'
|
|
32
|
-
*
|
|
33
|
-
* type R = Concat<[1], [2, 3]> // [1, 2, 3]
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export type Concat<A extends unknown[], B extends unknown[]> = [...A, ...B]
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Check if the type `A` is an array type and not a tuple.
|
|
40
|
-
*
|
|
41
|
-
* ```
|
|
42
|
-
* import type { ArrayType } from 'type-plus'
|
|
43
|
-
*
|
|
44
|
-
* type R = ArrayType<number[]> // true
|
|
45
|
-
* type R = ArrayType<[1]> // false
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
export type ArrayType<A extends unknown[], Then = A, Else = never> = NumberType<A['length'], Then, Else>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Add } from '../math/Add.js'
|
|
2
|
-
import { ArrayType } from './array.js'
|
|
3
|
-
|
|
4
|
-
export type Sum<A extends ArrayType<number[]>> = A['length'] extends 0
|
|
5
|
-
? 0
|
|
6
|
-
: A['length'] extends 1
|
|
7
|
-
? A[0]
|
|
8
|
-
: A['length'] extends 2
|
|
9
|
-
? Add<A[0], A[1]>
|
|
10
|
-
: A extends [infer F extends number, infer S extends number, ...infer Tail extends number[]]
|
|
11
|
-
? Sum<[Add<F, S>, ...Tail]>
|
|
12
|
-
: never
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { IsNever } from '../PrimitiveTypes.js'
|
|
2
|
-
import type { Abs } from '../math/Abs.js'
|
|
3
|
-
import type { GreaterThan } from '../math/GreaterThan.js'
|
|
4
|
-
import type { Subtract } from '../math/Subtract.js'
|
|
5
|
-
import type { Integer, Negative, NumberType } from '../number_plus/number.js'
|
|
6
|
-
import type { Equal } from '../predicates/Equal.js'
|
|
7
|
-
|
|
8
|
-
export type * from './array.js'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Gets the normalized index to access the element of an array or tuple.
|
|
12
|
-
*
|
|
13
|
-
* ```
|
|
14
|
-
* import type { ArrayPlus } from 'type-plus'
|
|
15
|
-
*
|
|
16
|
-
* type R = ArrayPlus.IndexAt<['a', 'b', 'c'], 2> // 2
|
|
17
|
-
* type R = ArrayPlus.IndexAt<['a', 'b', 'c'], -2> // 1
|
|
18
|
-
*
|
|
19
|
-
* type R = ArrayPlus.IndexAt<['a', 'b', 'c'], 3> // never
|
|
20
|
-
* type R = ArrayPlus.IndexAt<['a', 'b', 'c'], -4> // never
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export type IndexAt<A extends Array<unknown>, N extends number, Fail = never> = Equal<
|
|
24
|
-
A['length'],
|
|
25
|
-
0,
|
|
26
|
-
Fail,
|
|
27
|
-
Integer<
|
|
28
|
-
N,
|
|
29
|
-
NumberType<
|
|
30
|
-
A['length'],
|
|
31
|
-
// A: array
|
|
32
|
-
N,
|
|
33
|
-
// A: tuple
|
|
34
|
-
Negative<
|
|
35
|
-
N,
|
|
36
|
-
GreaterThan<Abs<N>, A['length']> extends true ? Fail : Subtract<A['length'], Abs<N>>,
|
|
37
|
-
GreaterThan<A['length'], N> extends true ? N : Fail
|
|
38
|
-
>
|
|
39
|
-
>,
|
|
40
|
-
// N: number or float
|
|
41
|
-
NumberType<
|
|
42
|
-
N,
|
|
43
|
-
// TODO: handle tuple to union of indexes
|
|
44
|
-
N,
|
|
45
|
-
Fail
|
|
46
|
-
>
|
|
47
|
-
>
|
|
48
|
-
>
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Is N an out of bound index of A.
|
|
52
|
-
*
|
|
53
|
-
* ```
|
|
54
|
-
* import { IsIndexOutOfBound } from 'type-plus'
|
|
55
|
-
*
|
|
56
|
-
* type R = IsIndexOutOfBound<[1], 0> // false
|
|
57
|
-
* type R = IsIndexOutOfBound<[1], -1> // false
|
|
58
|
-
|
|
59
|
-
* type R = IsIndexOutOfBound<[1], 1> // true
|
|
60
|
-
* type R = IsIndexOutOfBound<[1], -2> // true
|
|
61
|
-
*/
|
|
62
|
-
export type IsIndexOutOfBound<A extends unknown[], N extends number, Then = true, Else = false> = IsNever<
|
|
63
|
-
IndexAt<A, N>,
|
|
64
|
-
Then,
|
|
65
|
-
Else
|
|
66
|
-
>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { DigitArray } from '../math/index.js'
|
|
2
|
-
import type { IsPositive, IsWhole } from '../number_plus/number.js'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Creates `Tuple<T>` with `L` number of elements.
|
|
6
|
-
* @note Other cool implementations by @lazytype, @jcalz:
|
|
7
|
-
* @see https://github.com/microsoft/TypeScript/issues/26223#issuecomment-674514787
|
|
8
|
-
* @see https://github.com/microsoft/TypeScript/issues/47874#issuecomment-1039157322
|
|
9
|
-
*/
|
|
10
|
-
export type CreateTuple<L extends number, T = unknown, Fail = never> = number extends L
|
|
11
|
-
? T[]
|
|
12
|
-
: IsPositive<L> extends true
|
|
13
|
-
? IsWhole<L> extends true
|
|
14
|
-
? DigitArray.ToTuple<[], DigitArray.FromNumber<L>, T>
|
|
15
|
-
: Fail
|
|
16
|
-
: Fail
|
package/ts/array_plus/drop.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { Equal } from '../predicates/index.js'
|
|
2
|
-
import type { NonNull, NonUndefined } from '../utils/index.js'
|
|
3
|
-
|
|
4
|
-
export type DropFirst<A extends any[]> = number extends A['length']
|
|
5
|
-
? A
|
|
6
|
-
: A['length'] extends 0
|
|
7
|
-
? never[]
|
|
8
|
-
: A['length'] extends 1
|
|
9
|
-
? never[]
|
|
10
|
-
: A extends [any, ...infer Tail]
|
|
11
|
-
? Tail
|
|
12
|
-
: never
|
|
13
|
-
|
|
14
|
-
export type DropLast<A extends any[]> = number extends A['length']
|
|
15
|
-
? A
|
|
16
|
-
: A['length'] extends 0
|
|
17
|
-
? never[]
|
|
18
|
-
: A['length'] extends 1
|
|
19
|
-
? never[]
|
|
20
|
-
: A extends [...infer Heads, any]
|
|
21
|
-
? Heads
|
|
22
|
-
: never
|
|
23
|
-
|
|
24
|
-
type ExcludeUnionOfEmptyTuple<A> = Equal<A, []> extends true ? A : Exclude<A, []>
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* drops entries matching `Criteria` in array or tuple `A`.
|
|
28
|
-
*/
|
|
29
|
-
export type DropMatch<A extends Readonly<Array<any>>, Criteria> = number extends A['length']
|
|
30
|
-
? // array
|
|
31
|
-
A[0] extends Criteria
|
|
32
|
-
? // criteria matches: DropAll<string[], string>
|
|
33
|
-
never[]
|
|
34
|
-
: undefined extends Criteria
|
|
35
|
-
? null extends Criteria
|
|
36
|
-
? Array<NonNullable<A[0]>>
|
|
37
|
-
: Array<NonUndefined<A[0]>>
|
|
38
|
-
: null extends Criteria
|
|
39
|
-
? Array<NonNull<A[0]>>
|
|
40
|
-
: Criteria extends A[0]
|
|
41
|
-
? Array<Exclude<A[0], Criteria>>
|
|
42
|
-
: A[0] extends Criteria
|
|
43
|
-
? A
|
|
44
|
-
: Array<Exclude<A[0], Criteria>>
|
|
45
|
-
: DropMatchTuple<A, Criteria>
|
|
46
|
-
|
|
47
|
-
type DropMatchTuple<A extends Readonly<Array<any>>, Criteria> = A['length'] extends 0
|
|
48
|
-
? // empty tuple
|
|
49
|
-
A
|
|
50
|
-
: A extends readonly [infer Head, ...infer Tail]
|
|
51
|
-
? Tail['length'] extends 0
|
|
52
|
-
? // single element tuple
|
|
53
|
-
undefined extends Criteria
|
|
54
|
-
? ExcludeUnionOfEmptyTuple<Head extends Criteria ? [] : [Head]>
|
|
55
|
-
: ExcludeUnionOfEmptyTuple<Head extends Criteria ? [] : [Head]>
|
|
56
|
-
: // multiple elements
|
|
57
|
-
Exclude<Head, Criteria> extends never
|
|
58
|
-
? DropMatch<Tail, Criteria>
|
|
59
|
-
: [Exclude<Head, Criteria>, ...DropMatch<Tail, Criteria>]
|
|
60
|
-
: never[]
|
|
61
|
-
|
|
62
|
-
export type DropNull<A extends Array<any>> = DropMatch<A, null>
|
|
63
|
-
export type DropNullable<A extends Array<any>> = DropMatch<A, null | undefined>
|
|
64
|
-
export type DropUndefined<A extends Array<any>> = DropMatch<A, undefined>
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* drop a particular value from an array
|
|
68
|
-
*/
|
|
69
|
-
export function drop<A extends Readonly<Array<any>>, C>(array: A, value: C): DropMatch<A, C> {
|
|
70
|
-
return array.filter(v => v !== value) as DropMatch<A, C>
|
|
71
|
-
}
|
package/ts/array_plus/filter.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* filter the array or tuple `A`, keeping entries satisfying `Criteria`.
|
|
3
|
-
* @deprecated renaming to `KeepMatch`
|
|
4
|
-
*/
|
|
5
|
-
export type Filter<A extends Array<any>, Criteria> = number extends A['length']
|
|
6
|
-
? // array
|
|
7
|
-
A[0] extends Criteria
|
|
8
|
-
? A
|
|
9
|
-
: Criteria extends A[0]
|
|
10
|
-
? Array<Criteria>
|
|
11
|
-
: never[]
|
|
12
|
-
: // tuple
|
|
13
|
-
A['length'] extends 0
|
|
14
|
-
? never
|
|
15
|
-
: A extends [infer Head, ...infer Tail]
|
|
16
|
-
? Tail['length'] extends 0
|
|
17
|
-
? Head extends Criteria
|
|
18
|
-
? [Head]
|
|
19
|
-
: never[]
|
|
20
|
-
: Head extends Criteria
|
|
21
|
-
? [Head, ...Filter<Tail, Criteria>]
|
|
22
|
-
: Filter<Tail, Criteria>
|
|
23
|
-
: never
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* keeps entries satisfying `Criteria` in array or tuple `A`.
|
|
27
|
-
*/
|
|
28
|
-
export type KeepMatch<A extends Array<any>, Criteria> = Filter<A, Criteria>
|
package/ts/array_plus/index.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export type * from './array.js'
|
|
2
|
-
export type * from './common_prop_keys.js'
|
|
3
|
-
export type * from './create_tuple.js'
|
|
4
|
-
export * from './drop.js'
|
|
5
|
-
export type * from './filter.js'
|
|
6
|
-
export type * from './find_first.js'
|
|
7
|
-
export type * from './find_last.js'
|
|
8
|
-
export type * from './head.js'
|
|
9
|
-
export type * from './intersect_of_props.js'
|
|
10
|
-
export type * from './is_array.js'
|
|
11
|
-
export type * from './last.js'
|
|
12
|
-
export * from './literal_array.js'
|
|
13
|
-
export type * from './pad_left.js'
|
|
14
|
-
export * from './reduce_while.js'
|
|
15
|
-
export type * from './reverse.js'
|
|
16
|
-
export type * from './some.js'
|
|
17
|
-
export type * from './tail.js'
|
|
18
|
-
export type * from './union_of_props.js'
|
|
19
|
-
export type * from './union_of_values.js'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type IsArray<T, Then = true, Else = false> = T extends any[] ? Then : Else
|