type-plus 8.0.0-beta.6 → 8.0.0-beta.7
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/{esm/type_plus → cjs/$type}/$resolve_options.d.ts +2 -2
- package/cjs/$type/$resolve_options.d.ts.map +1 -0
- package/cjs/$type/$resolve_options.js.map +1 -0
- package/cjs/$type/$type.d.ts +34 -0
- package/cjs/$type/$type.d.ts.map +1 -0
- package/cjs/{type_plus → $type}/$type.js.map +1 -1
- package/{esm/type_plus → cjs/$type}/branch/$branch.d.ts +3 -3
- package/cjs/$type/branch/$branch.d.ts.map +1 -0
- package/cjs/$type/branch/$branch.js.map +1 -0
- package/{esm/type_plus → cjs/$type}/branch/$input_options.d.ts +2 -1
- package/cjs/$type/branch/$input_options.d.ts.map +1 -0
- package/cjs/$type/branch/$input_options.js.map +1 -0
- package/cjs/$type/branch/$resolve_branch.d.ts +22 -0
- package/cjs/$type/branch/$resolve_branch.d.ts.map +1 -0
- package/cjs/$type/branch/$resolve_branch.js.map +1 -0
- package/cjs/$type/branch/$selection.d.ts +161 -0
- package/cjs/$type/branch/$selection.d.ts.map +1 -0
- package/cjs/$type/branch/$selection.js.map +1 -0
- package/cjs/$type/distributive/$distributive.d.ts +27 -0
- package/cjs/$type/distributive/$distributive.d.ts.map +1 -0
- package/cjs/$type/distributive/$distributive.js.map +1 -0
- package/cjs/$type/errors/$error.d.ts +23 -0
- package/cjs/$type/errors/$error.d.ts.map +1 -0
- package/cjs/{type_plus → $type/errors}/$error.js.map +1 -1
- package/{esm/type_plus → cjs/$type/errors}/$infer_error.d.ts +7 -6
- package/cjs/$type/errors/$infer_error.d.ts.map +1 -0
- package/cjs/$type/errors/$infer_error.js.map +1 -0
- package/{esm/type → cjs/$type/errors}/failed.d.ts +4 -0
- package/cjs/$type/errors/failed.d.ts.map +1 -0
- package/cjs/{type → $type/errors}/failed.js.map +1 -1
- package/cjs/$type/exact/$exact.d.ts +27 -0
- package/cjs/$type/exact/$exact.d.ts.map +1 -0
- package/cjs/{type_plus/branch → $type/exact}/$exact.js.map +1 -1
- package/cjs/$type/special/$any.d.ts +36 -0
- package/cjs/$type/special/$any.d.ts.map +1 -0
- package/cjs/{any/any.js → $type/special/$any.js} +1 -1
- package/cjs/$type/special/$any.js.map +1 -0
- package/cjs/$type/special/$never.d.ts +52 -0
- package/cjs/$type/special/$never.d.ts.map +1 -0
- package/cjs/$type/special/$never.js +3 -0
- package/cjs/$type/special/$never.js.map +1 -0
- package/cjs/$type/special/$special.d.ts +31 -0
- package/cjs/$type/special/$special.d.ts.map +1 -0
- package/cjs/$type/special/$special.js +3 -0
- package/cjs/$type/special/$special.js.map +1 -0
- package/cjs/$type/special/$unknown.d.ts +37 -0
- package/cjs/$type/special/$unknown.d.ts.map +1 -0
- package/cjs/$type/special/$unknown.js +3 -0
- package/cjs/$type/special/$unknown.js.map +1 -0
- package/cjs/$type/special/$void.d.ts +46 -0
- package/cjs/$type/special/$void.d.ts.map +1 -0
- package/cjs/{never/never.js → $type/special/$void.js} +1 -1
- package/cjs/$type/special/$void.js.map +1 -0
- package/cjs/$type/utils/$merge_options.d.ts +14 -0
- package/cjs/$type/utils/$merge_options.d.ts.map +1 -0
- package/cjs/$type/utils/$merge_options.js.map +1 -0
- package/cjs/any/is_any.d.ts +23 -20
- package/cjs/any/is_any.d.ts.map +1 -1
- package/cjs/any/is_not_any.d.ts +15 -14
- package/cjs/any/is_not_any.d.ts.map +1 -1
- package/cjs/array/array.some.d.ts +1 -1
- package/cjs/array/array.some.d.ts.map +1 -1
- package/cjs/array/array_plus.common_prop_keys.d.ts +1 -1
- package/cjs/array/array_plus.common_prop_keys.d.ts.map +1 -1
- package/cjs/array/array_plus.filter.d.ts +2 -2
- package/cjs/array/array_plus.filter.d.ts.map +1 -1
- package/cjs/array/array_plus.find.d.ts +2 -2
- package/cjs/array/array_plus.find.d.ts.map +1 -1
- package/cjs/array/array_plus.index_at.d.ts +16 -10
- package/cjs/array/array_plus.index_at.d.ts.map +1 -1
- package/cjs/array/array_plus.index_at.js.map +1 -1
- package/cjs/array/array_plus.is_readonly.d.ts +3 -3
- package/cjs/array/array_plus.is_readonly.d.ts.map +1 -1
- package/cjs/array/head.d.ts +3 -3
- package/cjs/array/head.d.ts.map +1 -1
- package/cjs/array/is_array.d.ts +23 -19
- package/cjs/array/is_array.d.ts.map +1 -1
- package/cjs/array/is_not_array.d.ts +23 -19
- package/cjs/array/is_not_array.d.ts.map +1 -1
- package/cjs/array/last.d.ts +5 -3
- package/cjs/array/last.d.ts.map +1 -1
- package/cjs/assertion/assert_type.d.ts.map +1 -1
- package/cjs/bigint/is_bigint.d.ts +20 -16
- package/cjs/bigint/is_bigint.d.ts.map +1 -1
- package/cjs/bigint/is_bigint_literal.d.ts +18 -13
- package/cjs/bigint/is_bigint_literal.d.ts.map +1 -1
- package/cjs/bigint/is_not_bigint.d.ts +20 -16
- package/cjs/bigint/is_not_bigint.d.ts.map +1 -1
- package/cjs/bigint/is_not_bigint_literal.d.ts +19 -13
- package/cjs/bigint/is_not_bigint_literal.d.ts.map +1 -1
- package/cjs/binary/_binary.d.ts +2 -1
- package/cjs/binary/_binary.d.ts.map +1 -1
- package/cjs/binary/_binary.js +3 -0
- package/cjs/binary/_binary.js.map +1 -1
- package/cjs/binary/bit.d.ts +26 -0
- package/cjs/binary/bit.d.ts.map +1 -0
- package/cjs/binary/{Bit.js → bit.js} +1 -1
- package/cjs/binary/bit.js.map +1 -0
- package/cjs/boolean/is_boolean.d.ts +20 -16
- package/cjs/boolean/is_boolean.d.ts.map +1 -1
- package/cjs/boolean/is_false.d.ts +15 -9
- package/cjs/boolean/is_false.d.ts.map +1 -1
- package/cjs/boolean/is_not_boolean.d.ts +21 -16
- package/cjs/boolean/is_not_boolean.d.ts.map +1 -1
- package/cjs/boolean/is_not_false.d.ts +16 -9
- package/cjs/boolean/is_not_false.d.ts.map +1 -1
- package/cjs/boolean/is_not_true.d.ts +15 -9
- package/cjs/boolean/is_not_true.d.ts.map +1 -1
- package/cjs/boolean/is_true.d.ts +15 -9
- package/cjs/boolean/is_true.d.ts.map +1 -1
- package/cjs/equal/equal.d.ts +189 -74
- package/cjs/equal/equal.d.ts.map +1 -1
- package/cjs/equal/identity_equal.d.ts +5 -1
- package/cjs/equal/identity_equal.d.ts.map +1 -1
- package/cjs/equal/is_equal.d.ts +102 -0
- package/cjs/equal/is_equal.d.ts.map +1 -0
- package/cjs/equal/is_equal.js +3 -0
- package/cjs/equal/is_equal.js.map +1 -0
- package/cjs/function/is_function.d.ts +28 -5
- package/cjs/function/is_function.d.ts.map +1 -1
- package/cjs/function/is_not_function.d.ts +1 -1
- package/cjs/function/is_not_function.d.ts.map +1 -1
- package/cjs/function/is_not_strict_function.d.ts +15 -13
- package/cjs/function/is_not_strict_function.d.ts.map +1 -1
- package/cjs/function/is_strict_function.d.ts +22 -17
- package/cjs/function/is_strict_function.d.ts.map +1 -1
- package/cjs/functional/Maybe.d.ts +1 -1
- package/cjs/functional/Maybe.d.ts.map +1 -1
- package/cjs/functional/compose.d.ts.map +1 -1
- package/cjs/functional/compose.js +1 -3
- package/cjs/functional/compose.js.map +1 -1
- package/cjs/index.d.ts +20 -21
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/logical/logical.d.ts +35 -0
- package/cjs/logical/logical.d.ts.map +1 -0
- package/cjs/{predicates → logical}/logical.js.map +1 -1
- package/cjs/math/abs.d.ts +1 -1
- package/cjs/math/abs.d.ts.map +1 -1
- package/cjs/mix_types/box.d.ts +2 -2
- package/cjs/mix_types/box.d.ts.map +1 -1
- package/cjs/mix_types/is_any_or_never.d.ts +2 -3
- package/cjs/mix_types/is_any_or_never.d.ts.map +1 -1
- package/cjs/mix_types/merge.d.ts +18 -6
- package/cjs/mix_types/merge.d.ts.map +1 -1
- package/cjs/mix_types/merge.js.map +1 -1
- package/cjs/never/is_never.d.ts +16 -15
- package/cjs/never/is_never.d.ts.map +1 -1
- package/cjs/never/is_not_never.d.ts +16 -15
- package/cjs/never/is_not_never.d.ts.map +1 -1
- package/cjs/null/is_not_null.d.ts +15 -9
- package/cjs/null/is_not_null.d.ts.map +1 -1
- package/cjs/null/is_null.d.ts +15 -9
- package/cjs/null/is_null.d.ts.map +1 -1
- package/cjs/number/is_not_number.d.ts +20 -16
- package/cjs/number/is_not_number.d.ts.map +1 -1
- package/cjs/number/is_not_number_literal.d.ts +18 -13
- package/cjs/number/is_not_number_literal.d.ts.map +1 -1
- package/cjs/number/is_number.d.ts +20 -16
- package/cjs/number/is_number.d.ts.map +1 -1
- package/cjs/number/is_number_literal.d.ts +18 -13
- package/cjs/number/is_number_literal.d.ts.map +1 -1
- package/cjs/numeric/is_integer.d.ts +18 -12
- package/cjs/numeric/is_integer.d.ts.map +1 -1
- package/cjs/numeric/is_negative.d.ts +19 -13
- package/cjs/numeric/is_negative.d.ts.map +1 -1
- package/cjs/numeric/is_not_integer.d.ts +13 -7
- package/cjs/numeric/is_not_integer.d.ts.map +1 -1
- package/cjs/numeric/is_not_negative.d.ts +15 -9
- package/cjs/numeric/is_not_negative.d.ts.map +1 -1
- package/cjs/numeric/is_not_numeric.d.ts +1 -1
- package/cjs/numeric/is_not_numeric.d.ts.map +1 -1
- package/cjs/numeric/is_not_positive.d.ts +13 -7
- package/cjs/numeric/is_not_positive.d.ts.map +1 -1
- package/cjs/numeric/is_numeric.d.ts +28 -5
- package/cjs/numeric/is_numeric.d.ts.map +1 -1
- package/cjs/numeric/is_positive.d.ts +19 -13
- package/cjs/numeric/is_positive.d.ts.map +1 -1
- package/cjs/object/ANotB.d.ts +2 -2
- package/cjs/object/ANotB.d.ts.map +1 -1
- package/cjs/object/KeysWithDiffType.d.ts +1 -1
- package/cjs/object/KeysWithDiffType.d.ts.map +1 -1
- package/cjs/object/adjust_exact_optional_props.d.ts +1 -1
- package/cjs/object/adjust_exact_optional_props.d.ts.map +1 -1
- package/cjs/object/is_not_object.d.ts +23 -19
- package/cjs/object/is_not_object.d.ts.map +1 -1
- package/cjs/object/is_object.d.ts +23 -19
- package/cjs/object/is_object.d.ts.map +1 -1
- package/cjs/object/left_join.d.ts +2 -2
- package/cjs/object/left_join.d.ts.map +1 -1
- package/cjs/object/mapProperties.d.ts +1 -1
- package/cjs/object/mapProperties.d.ts.map +1 -1
- package/cjs/object/mapProperties.js.map +1 -1
- package/cjs/object/merge.d.ts +55 -49
- package/cjs/object/merge.d.ts.map +1 -1
- package/cjs/object/optional_key.d.ts +1 -1
- package/cjs/object/optional_key.d.ts.map +1 -1
- package/cjs/object/record.d.ts.map +1 -1
- package/cjs/object/split.d.ts +1 -1
- package/cjs/object/split.d.ts.map +1 -1
- package/cjs/predicates/CanAssign.d.ts +1 -1
- package/cjs/predicates/CanAssign.d.ts.map +1 -1
- package/cjs/predicates/assignable.d.ts +23 -25
- package/cjs/predicates/assignable.d.ts.map +1 -1
- package/cjs/predicates/index.d.ts +1 -1
- package/cjs/predicates/index.d.ts.map +1 -1
- package/cjs/predicates/not_assignable.d.ts +24 -26
- package/cjs/predicates/not_assignable.d.ts.map +1 -1
- package/cjs/string/is_not_string.d.ts +20 -17
- package/cjs/string/is_not_string.d.ts.map +1 -1
- package/cjs/string/is_not_string_literal.d.ts +25 -22
- package/cjs/string/is_not_string_literal.d.ts.map +1 -1
- package/cjs/string/is_not_template_literal.d.ts +18 -13
- package/cjs/string/is_not_template_literal.d.ts.map +1 -1
- package/cjs/string/is_string.d.ts +20 -16
- package/cjs/string/is_string.d.ts.map +1 -1
- package/cjs/string/is_string_literal.d.ts +25 -22
- package/cjs/string/is_string_literal.d.ts.map +1 -1
- package/cjs/string/is_template_literal.d.ts +18 -13
- package/cjs/string/is_template_literal.d.ts.map +1 -1
- package/cjs/symbol/is_not_symbol.d.ts +15 -9
- package/cjs/symbol/is_not_symbol.d.ts.map +1 -1
- package/cjs/symbol/is_symbol.d.ts +15 -9
- package/cjs/symbol/is_symbol.d.ts.map +1 -1
- package/cjs/testing/stub.d.ts +0 -1
- package/cjs/testing/stub.d.ts.map +1 -1
- package/cjs/testing/stub.js.map +1 -1
- package/cjs/testing/test_type.d.ts +1 -1
- package/cjs/testing/test_type.d.ts.map +1 -1
- package/cjs/tuple/is_not_tuple.d.ts +18 -13
- package/cjs/tuple/is_not_tuple.d.ts.map +1 -1
- package/cjs/tuple/is_tuple.d.ts +18 -13
- package/cjs/tuple/is_tuple.d.ts.map +1 -1
- package/cjs/tuple/tuple_plus.common_prop_keys.d.ts +1 -1
- package/cjs/tuple/tuple_plus.common_prop_keys.d.ts.map +1 -1
- package/cjs/tuple/tuple_plus.drop_match.d.ts +1 -1
- package/cjs/tuple/tuple_plus.drop_match.d.ts.map +1 -1
- package/cjs/tuple/tuple_plus.find.d.ts +1 -1
- package/cjs/tuple/tuple_plus.find.d.ts.map +1 -1
- package/cjs/type-guard/is_type.d.ts +1 -1
- package/cjs/type-guard/is_type.d.ts.map +1 -1
- package/cjs/undefined/has_undefined.d.ts +4 -5
- package/cjs/undefined/has_undefined.d.ts.map +1 -1
- package/cjs/undefined/is_not_undefined.d.ts +15 -9
- package/cjs/undefined/is_not_undefined.d.ts.map +1 -1
- package/cjs/undefined/is_undefined.d.ts +15 -9
- package/cjs/undefined/is_undefined.d.ts.map +1 -1
- package/cjs/unknown/is_not_unknown.d.ts +15 -14
- package/cjs/unknown/is_not_unknown.d.ts.map +1 -1
- package/cjs/unknown/is_unknown.d.ts +15 -14
- package/cjs/unknown/is_unknown.d.ts.map +1 -1
- package/cjs/unknown/not_unknown_or.d.ts +1 -1
- package/cjs/unknown/not_unknown_or.d.ts.map +1 -1
- package/cjs/utils/Widen.d.ts +9 -2
- package/cjs/utils/Widen.d.ts.map +1 -1
- package/cjs/utils/excessive.d.ts +12 -0
- package/cjs/utils/excessive.d.ts.map +1 -0
- package/cjs/utils/excessive.js +3 -0
- package/cjs/utils/excessive.js.map +1 -0
- package/cjs/{type → utils}/no_infer.d.ts +9 -7
- package/cjs/utils/no_infer.d.ts.map +1 -0
- package/cjs/{type → utils}/no_infer.js.map +1 -1
- package/cjs/void/is_not_void.d.ts +17 -10
- package/cjs/void/is_not_void.d.ts.map +1 -1
- package/cjs/void/is_void.d.ts +17 -10
- package/cjs/void/is_void.d.ts.map +1 -1
- package/{cjs/type_plus → esm/$type}/$resolve_options.d.ts +2 -2
- package/esm/$type/$resolve_options.d.ts.map +1 -0
- package/esm/$type/$resolve_options.js.map +1 -0
- package/esm/$type/$type.d.ts +34 -0
- package/esm/$type/$type.d.ts.map +1 -0
- package/esm/{type_plus → $type}/$type.js.map +1 -1
- package/{cjs/type_plus → esm/$type}/branch/$branch.d.ts +3 -3
- package/esm/$type/branch/$branch.d.ts.map +1 -0
- package/esm/$type/branch/$branch.js.map +1 -0
- package/{cjs/type_plus → esm/$type}/branch/$input_options.d.ts +2 -1
- package/esm/$type/branch/$input_options.d.ts.map +1 -0
- package/esm/$type/branch/$input_options.js.map +1 -0
- package/esm/$type/branch/$resolve_branch.d.ts +22 -0
- package/esm/$type/branch/$resolve_branch.d.ts.map +1 -0
- package/esm/$type/branch/$resolve_branch.js.map +1 -0
- package/esm/$type/branch/$selection.d.ts +161 -0
- package/esm/$type/branch/$selection.d.ts.map +1 -0
- package/esm/$type/branch/$selection.js.map +1 -0
- package/esm/$type/distributive/$distributive.d.ts +27 -0
- package/esm/$type/distributive/$distributive.d.ts.map +1 -0
- package/esm/$type/distributive/$distributive.js.map +1 -0
- package/esm/$type/errors/$error.d.ts +23 -0
- package/esm/$type/errors/$error.d.ts.map +1 -0
- package/esm/{type_plus → $type/errors}/$error.js.map +1 -1
- package/{cjs/type_plus → esm/$type/errors}/$infer_error.d.ts +7 -6
- package/esm/$type/errors/$infer_error.d.ts.map +1 -0
- package/esm/$type/errors/$infer_error.js.map +1 -0
- package/{cjs/type → esm/$type/errors}/failed.d.ts +4 -0
- package/esm/$type/errors/failed.d.ts.map +1 -0
- package/esm/{type → $type/errors}/failed.js.map +1 -1
- package/esm/$type/exact/$exact.d.ts +27 -0
- package/esm/$type/exact/$exact.d.ts.map +1 -0
- package/esm/{type_plus/branch → $type/exact}/$exact.js.map +1 -1
- package/esm/$type/special/$any.d.ts +36 -0
- package/esm/$type/special/$any.d.ts.map +1 -0
- package/esm/$type/special/$any.js +2 -0
- package/esm/$type/special/$any.js.map +1 -0
- package/esm/$type/special/$never.d.ts +52 -0
- package/esm/$type/special/$never.d.ts.map +1 -0
- package/esm/$type/special/$never.js +2 -0
- package/esm/$type/special/$never.js.map +1 -0
- package/esm/$type/special/$special.d.ts +31 -0
- package/esm/$type/special/$special.d.ts.map +1 -0
- package/esm/$type/special/$special.js +2 -0
- package/esm/$type/special/$special.js.map +1 -0
- package/esm/$type/special/$unknown.d.ts +37 -0
- package/esm/$type/special/$unknown.d.ts.map +1 -0
- package/esm/$type/special/$unknown.js +2 -0
- package/esm/$type/special/$unknown.js.map +1 -0
- package/esm/$type/special/$void.d.ts +46 -0
- package/esm/$type/special/$void.d.ts.map +1 -0
- package/esm/$type/special/$void.js +2 -0
- package/esm/$type/special/$void.js.map +1 -0
- package/esm/$type/utils/$merge_options.d.ts +14 -0
- package/esm/$type/utils/$merge_options.d.ts.map +1 -0
- package/esm/$type/utils/$merge_options.js.map +1 -0
- package/esm/any/is_any.d.ts +23 -20
- package/esm/any/is_any.d.ts.map +1 -1
- package/esm/any/is_not_any.d.ts +15 -14
- package/esm/any/is_not_any.d.ts.map +1 -1
- package/esm/array/array.some.d.ts +1 -1
- package/esm/array/array.some.d.ts.map +1 -1
- package/esm/array/array_plus.common_prop_keys.d.ts +1 -1
- package/esm/array/array_plus.common_prop_keys.d.ts.map +1 -1
- package/esm/array/array_plus.filter.d.ts +2 -2
- package/esm/array/array_plus.filter.d.ts.map +1 -1
- package/esm/array/array_plus.find.d.ts +2 -2
- package/esm/array/array_plus.find.d.ts.map +1 -1
- package/esm/array/array_plus.index_at.d.ts +16 -10
- package/esm/array/array_plus.index_at.d.ts.map +1 -1
- package/esm/array/array_plus.index_at.js.map +1 -1
- package/esm/array/array_plus.is_readonly.d.ts +3 -3
- package/esm/array/array_plus.is_readonly.d.ts.map +1 -1
- package/esm/array/head.d.ts +3 -3
- package/esm/array/head.d.ts.map +1 -1
- package/esm/array/is_array.d.ts +23 -19
- package/esm/array/is_array.d.ts.map +1 -1
- package/esm/array/is_not_array.d.ts +23 -19
- package/esm/array/is_not_array.d.ts.map +1 -1
- package/esm/array/last.d.ts +5 -3
- package/esm/array/last.d.ts.map +1 -1
- package/esm/assertion/assert_type.d.ts.map +1 -1
- package/esm/assertion/assert_type.js.map +1 -1
- package/esm/bigint/is_bigint.d.ts +20 -16
- package/esm/bigint/is_bigint.d.ts.map +1 -1
- package/esm/bigint/is_bigint_literal.d.ts +18 -13
- package/esm/bigint/is_bigint_literal.d.ts.map +1 -1
- package/esm/bigint/is_not_bigint.d.ts +20 -16
- package/esm/bigint/is_not_bigint.d.ts.map +1 -1
- package/esm/bigint/is_not_bigint_literal.d.ts +19 -13
- package/esm/bigint/is_not_bigint_literal.d.ts.map +1 -1
- package/esm/binary/_binary.d.ts +2 -1
- package/esm/binary/_binary.d.ts.map +1 -1
- package/esm/binary/_binary.js +2 -1
- package/esm/binary/_binary.js.map +1 -1
- package/esm/binary/bit.d.ts +26 -0
- package/esm/binary/bit.d.ts.map +1 -0
- package/esm/binary/bit.js +2 -0
- package/esm/binary/bit.js.map +1 -0
- package/esm/boolean/is_boolean.d.ts +20 -16
- package/esm/boolean/is_boolean.d.ts.map +1 -1
- package/esm/boolean/is_false.d.ts +15 -9
- package/esm/boolean/is_false.d.ts.map +1 -1
- package/esm/boolean/is_not_boolean.d.ts +21 -16
- package/esm/boolean/is_not_boolean.d.ts.map +1 -1
- package/esm/boolean/is_not_false.d.ts +16 -9
- package/esm/boolean/is_not_false.d.ts.map +1 -1
- package/esm/boolean/is_not_true.d.ts +15 -9
- package/esm/boolean/is_not_true.d.ts.map +1 -1
- package/esm/boolean/is_true.d.ts +15 -9
- package/esm/boolean/is_true.d.ts.map +1 -1
- package/esm/equal/equal.d.ts +189 -74
- package/esm/equal/equal.d.ts.map +1 -1
- package/esm/equal/identity_equal.d.ts +5 -1
- package/esm/equal/identity_equal.d.ts.map +1 -1
- package/esm/equal/is_equal.d.ts +102 -0
- package/esm/equal/is_equal.d.ts.map +1 -0
- package/esm/equal/is_equal.js +2 -0
- package/esm/equal/is_equal.js.map +1 -0
- package/esm/function/is_function.d.ts +28 -5
- package/esm/function/is_function.d.ts.map +1 -1
- package/esm/function/is_not_function.d.ts +1 -1
- package/esm/function/is_not_function.d.ts.map +1 -1
- package/esm/function/is_not_strict_function.d.ts +15 -13
- package/esm/function/is_not_strict_function.d.ts.map +1 -1
- package/esm/function/is_strict_function.d.ts +22 -17
- package/esm/function/is_strict_function.d.ts.map +1 -1
- package/esm/functional/Maybe.d.ts +1 -1
- package/esm/functional/Maybe.d.ts.map +1 -1
- package/esm/functional/compose.d.ts.map +1 -1
- package/esm/functional/compose.js +1 -3
- package/esm/functional/compose.js.map +1 -1
- package/esm/index.d.ts +20 -21
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/logical/logical.d.ts +35 -0
- package/esm/logical/logical.d.ts.map +1 -0
- package/esm/{predicates → logical}/logical.js.map +1 -1
- package/esm/math/abs.d.ts +1 -1
- package/esm/math/abs.d.ts.map +1 -1
- package/esm/mix_types/box.d.ts +2 -2
- package/esm/mix_types/box.d.ts.map +1 -1
- package/esm/mix_types/is_any_or_never.d.ts +2 -3
- package/esm/mix_types/is_any_or_never.d.ts.map +1 -1
- package/esm/mix_types/merge.d.ts +18 -6
- package/esm/mix_types/merge.d.ts.map +1 -1
- package/esm/mix_types/merge.js.map +1 -1
- package/esm/never/is_never.d.ts +16 -15
- package/esm/never/is_never.d.ts.map +1 -1
- package/esm/never/is_not_never.d.ts +16 -15
- package/esm/never/is_not_never.d.ts.map +1 -1
- package/esm/null/is_not_null.d.ts +15 -9
- package/esm/null/is_not_null.d.ts.map +1 -1
- package/esm/null/is_null.d.ts +15 -9
- package/esm/null/is_null.d.ts.map +1 -1
- package/esm/number/is_not_number.d.ts +20 -16
- package/esm/number/is_not_number.d.ts.map +1 -1
- package/esm/number/is_not_number_literal.d.ts +18 -13
- package/esm/number/is_not_number_literal.d.ts.map +1 -1
- package/esm/number/is_number.d.ts +20 -16
- package/esm/number/is_number.d.ts.map +1 -1
- package/esm/number/is_number_literal.d.ts +18 -13
- package/esm/number/is_number_literal.d.ts.map +1 -1
- package/esm/numeric/is_integer.d.ts +18 -12
- package/esm/numeric/is_integer.d.ts.map +1 -1
- package/esm/numeric/is_negative.d.ts +19 -13
- package/esm/numeric/is_negative.d.ts.map +1 -1
- package/esm/numeric/is_not_integer.d.ts +13 -7
- package/esm/numeric/is_not_integer.d.ts.map +1 -1
- package/esm/numeric/is_not_negative.d.ts +15 -9
- package/esm/numeric/is_not_negative.d.ts.map +1 -1
- package/esm/numeric/is_not_numeric.d.ts +1 -1
- package/esm/numeric/is_not_numeric.d.ts.map +1 -1
- package/esm/numeric/is_not_positive.d.ts +13 -7
- package/esm/numeric/is_not_positive.d.ts.map +1 -1
- package/esm/numeric/is_numeric.d.ts +28 -5
- package/esm/numeric/is_numeric.d.ts.map +1 -1
- package/esm/numeric/is_positive.d.ts +19 -13
- package/esm/numeric/is_positive.d.ts.map +1 -1
- package/esm/object/ANotB.d.ts +2 -2
- package/esm/object/ANotB.d.ts.map +1 -1
- package/esm/object/KeysWithDiffType.d.ts +1 -1
- package/esm/object/KeysWithDiffType.d.ts.map +1 -1
- package/esm/object/adjust_exact_optional_props.d.ts +1 -1
- package/esm/object/adjust_exact_optional_props.d.ts.map +1 -1
- package/esm/object/is_not_object.d.ts +23 -19
- package/esm/object/is_not_object.d.ts.map +1 -1
- package/esm/object/is_object.d.ts +23 -19
- package/esm/object/is_object.d.ts.map +1 -1
- package/esm/object/left_join.d.ts +2 -2
- package/esm/object/left_join.d.ts.map +1 -1
- package/esm/object/mapProperties.d.ts +1 -1
- package/esm/object/mapProperties.d.ts.map +1 -1
- package/esm/object/mapProperties.js.map +1 -1
- package/esm/object/merge.d.ts +55 -49
- package/esm/object/merge.d.ts.map +1 -1
- package/esm/object/optional_key.d.ts +1 -1
- package/esm/object/optional_key.d.ts.map +1 -1
- package/esm/object/record.d.ts.map +1 -1
- package/esm/object/split.d.ts +1 -1
- package/esm/object/split.d.ts.map +1 -1
- package/esm/predicates/CanAssign.d.ts +1 -1
- package/esm/predicates/CanAssign.d.ts.map +1 -1
- package/esm/predicates/assignable.d.ts +23 -25
- package/esm/predicates/assignable.d.ts.map +1 -1
- package/esm/predicates/index.d.ts +1 -1
- package/esm/predicates/index.d.ts.map +1 -1
- package/esm/predicates/not_assignable.d.ts +24 -26
- package/esm/predicates/not_assignable.d.ts.map +1 -1
- package/esm/string/is_not_string.d.ts +20 -17
- package/esm/string/is_not_string.d.ts.map +1 -1
- package/esm/string/is_not_string_literal.d.ts +25 -22
- package/esm/string/is_not_string_literal.d.ts.map +1 -1
- package/esm/string/is_not_template_literal.d.ts +18 -13
- package/esm/string/is_not_template_literal.d.ts.map +1 -1
- package/esm/string/is_string.d.ts +20 -16
- package/esm/string/is_string.d.ts.map +1 -1
- package/esm/string/is_string_literal.d.ts +25 -22
- package/esm/string/is_string_literal.d.ts.map +1 -1
- package/esm/string/is_template_literal.d.ts +18 -13
- package/esm/string/is_template_literal.d.ts.map +1 -1
- package/esm/symbol/is_not_symbol.d.ts +15 -9
- package/esm/symbol/is_not_symbol.d.ts.map +1 -1
- package/esm/symbol/is_symbol.d.ts +15 -9
- package/esm/symbol/is_symbol.d.ts.map +1 -1
- package/esm/testing/stub.d.ts +0 -1
- package/esm/testing/stub.d.ts.map +1 -1
- package/esm/testing/stub.js.map +1 -1
- package/esm/testing/test_type.d.ts +1 -1
- package/esm/testing/test_type.d.ts.map +1 -1
- package/esm/tuple/is_not_tuple.d.ts +18 -13
- package/esm/tuple/is_not_tuple.d.ts.map +1 -1
- package/esm/tuple/is_tuple.d.ts +18 -13
- package/esm/tuple/is_tuple.d.ts.map +1 -1
- package/esm/tuple/tuple_plus.common_prop_keys.d.ts +1 -1
- package/esm/tuple/tuple_plus.common_prop_keys.d.ts.map +1 -1
- package/esm/tuple/tuple_plus.drop_match.d.ts +1 -1
- package/esm/tuple/tuple_plus.drop_match.d.ts.map +1 -1
- package/esm/tuple/tuple_plus.find.d.ts +1 -1
- package/esm/tuple/tuple_plus.find.d.ts.map +1 -1
- package/esm/type-guard/is_type.d.ts +1 -1
- package/esm/type-guard/is_type.d.ts.map +1 -1
- package/esm/undefined/has_undefined.d.ts +4 -5
- package/esm/undefined/has_undefined.d.ts.map +1 -1
- package/esm/undefined/is_not_undefined.d.ts +15 -9
- package/esm/undefined/is_not_undefined.d.ts.map +1 -1
- package/esm/undefined/is_undefined.d.ts +15 -9
- package/esm/undefined/is_undefined.d.ts.map +1 -1
- package/esm/unknown/is_not_unknown.d.ts +15 -14
- package/esm/unknown/is_not_unknown.d.ts.map +1 -1
- package/esm/unknown/is_unknown.d.ts +15 -14
- package/esm/unknown/is_unknown.d.ts.map +1 -1
- package/esm/unknown/not_unknown_or.d.ts +1 -1
- package/esm/unknown/not_unknown_or.d.ts.map +1 -1
- package/esm/utils/Widen.d.ts +9 -2
- package/esm/utils/Widen.d.ts.map +1 -1
- package/esm/utils/excessive.d.ts +12 -0
- package/esm/utils/excessive.d.ts.map +1 -0
- package/esm/utils/excessive.js +2 -0
- package/esm/utils/excessive.js.map +1 -0
- package/esm/{type → utils}/no_infer.d.ts +9 -7
- package/esm/utils/no_infer.d.ts.map +1 -0
- package/esm/{type → utils}/no_infer.js.map +1 -1
- package/esm/void/is_not_void.d.ts +17 -10
- package/esm/void/is_not_void.d.ts.map +1 -1
- package/esm/void/is_void.d.ts +17 -10
- package/esm/void/is_void.d.ts.map +1 -1
- package/package.json +5 -5
- package/readme.md +74 -74
- package/src/{type_plus → $type}/$resolve_options.ts +4 -2
- package/src/$type/$type.ts +37 -0
- package/src/{type_plus → $type}/branch/$branch.ts +4 -2
- package/src/{type_plus → $type}/branch/$input_options.ts +2 -1
- package/src/$type/branch/$resolve_branch.ts +46 -0
- package/src/$type/branch/$selection.ts +170 -0
- package/src/$type/branch/readme.md +78 -0
- package/src/$type/distributive/$distributive.ts +34 -0
- package/src/$type/distributive/readme.md +26 -0
- package/src/$type/errors/$error.ts +20 -0
- package/src/{type_plus → $type/errors}/$infer_error.ts +7 -8
- package/src/{type → $type/errors}/failed.ts +4 -0
- package/src/$type/errors/readme.md +60 -0
- package/src/$type/exact/$exact.ts +34 -0
- package/src/$type/exact/readme.md +27 -0
- package/src/$type/readme.md +23 -0
- package/src/$type/special/$any.ts +34 -0
- package/src/$type/special/$never.ts +51 -0
- package/src/$type/special/$special.ts +40 -0
- package/src/$type/special/$unknown.ts +35 -0
- package/src/$type/special/$void.ts +44 -0
- package/src/$type/special/readme.md +51 -0
- package/src/$type/utils/$merge_options.ts +11 -0
- package/src/$type/utils/readme.md +10 -0
- package/src/any/is_any.ts +23 -20
- package/src/any/is_not_any.ts +15 -14
- package/src/any/readme.md +30 -19
- package/src/array/array.some.ts +1 -1
- package/src/array/array_plus.common_prop_keys.ts +1 -1
- package/src/array/array_plus.filter.ts +2 -2
- package/src/array/array_plus.find.ts +2 -2
- package/src/array/array_plus.index_at.ts +23 -29
- package/src/array/array_plus.is_readonly.ts +3 -3
- package/src/array/head.ts +3 -3
- package/src/array/is_array.ts +30 -23
- package/src/array/is_not_array.ts +30 -23
- package/src/array/last.ts +6 -14
- package/src/array/readme.md +3 -3
- package/src/assertion/assert_type.ts +1 -1
- package/src/bigint/is_bigint.ts +28 -21
- package/src/bigint/is_bigint_literal.ts +25 -17
- package/src/bigint/is_not_bigint.ts +27 -20
- package/src/bigint/is_not_bigint_literal.ts +26 -17
- package/src/bigint/readme.md +25 -8
- package/src/binary/_binary.ts +2 -1
- package/src/binary/bit.ts +29 -0
- package/src/binary/readme.md +11 -0
- package/src/boolean/is_boolean.ts +30 -23
- package/src/boolean/is_false.ts +18 -9
- package/src/boolean/is_not_boolean.ts +30 -22
- package/src/boolean/is_not_false.ts +19 -9
- package/src/boolean/is_not_true.ts +18 -9
- package/src/boolean/is_true.ts +18 -9
- package/src/equal/equal.ts +307 -89
- package/src/equal/identity_equal.ts +3 -7
- package/src/equal/is_equal.ts +150 -0
- package/src/equal/readme.md +20 -1
- package/src/function/is_function.ts +37 -5
- package/src/function/is_not_function.ts +1 -1
- package/src/function/is_not_strict_function.ts +16 -14
- package/src/function/is_strict_function.ts +29 -21
- package/src/functional/Maybe.ts +1 -1
- package/src/functional/compose.ts +1 -3
- package/src/index.ts +20 -21
- package/src/logical/logical.ts +52 -0
- package/src/logical/readme.md +53 -0
- package/src/math/abs.ts +1 -1
- package/src/mix_types/box.ts +2 -2
- package/src/mix_types/is_any_or_never.ts +2 -3
- package/src/mix_types/merge.ts +22 -17
- package/src/never/is_never.ts +16 -15
- package/src/never/is_not_never.ts +16 -15
- package/src/null/is_not_null.ts +18 -9
- package/src/null/is_null.ts +18 -9
- package/src/number/is_not_number.ts +27 -20
- package/src/number/is_not_number_literal.ts +25 -17
- package/src/number/is_number.ts +27 -20
- package/src/number/is_number_literal.ts +25 -17
- package/src/numeric/is_integer.ts +29 -30
- package/src/numeric/is_negative.ts +29 -20
- package/src/numeric/is_not_integer.ts +19 -10
- package/src/numeric/is_not_negative.ts +25 -13
- package/src/numeric/is_not_numeric.ts +1 -1
- package/src/numeric/is_not_positive.ts +19 -9
- package/src/numeric/is_numeric.ts +37 -5
- package/src/numeric/is_positive.ts +29 -21
- package/src/object/ANotB.ts +2 -2
- package/src/object/KeysWithDiffType.ts +1 -1
- package/src/object/adjust_exact_optional_props.ts +1 -1
- package/src/object/is_not_object.ts +29 -22
- package/src/object/is_object.ts +29 -22
- package/src/object/left_join.ts +2 -2
- package/src/object/mapProperties.ts +1 -1
- package/src/object/merge.ts +54 -50
- package/src/object/optional_key.ts +1 -1
- package/src/object/record.ts +1 -1
- package/src/object/split.ts +1 -1
- package/src/predicates/CanAssign.ts +1 -1
- package/src/predicates/assignable.ts +23 -25
- package/src/predicates/index.ts +1 -1
- package/src/predicates/not_assignable.ts +24 -26
- package/src/string/is_not_string.ts +29 -23
- package/src/string/is_not_string_literal.ts +36 -30
- package/src/string/is_not_template_literal.ts +24 -16
- package/src/string/is_string.ts +27 -20
- package/src/string/is_string_literal.ts +36 -30
- package/src/string/is_template_literal.ts +24 -16
- package/src/symbol/is_not_symbol.ts +18 -9
- package/src/symbol/is_symbol.ts +18 -9
- package/src/testing/stub.ts +0 -1
- package/src/testing/test_type.ts +1 -1
- package/src/tuple/is_not_tuple.ts +26 -17
- package/src/tuple/is_tuple.ts +25 -17
- package/src/tuple/tuple_plus.common_prop_keys.ts +1 -1
- package/src/tuple/tuple_plus.drop_match.ts +1 -1
- package/src/tuple/tuple_plus.find.ts +1 -1
- package/src/type-guard/is_type.ts +1 -1
- package/src/undefined/has_undefined.ts +5 -6
- package/src/undefined/is_not_undefined.ts +18 -9
- package/src/undefined/is_undefined.ts +18 -9
- package/src/unknown/is_not_unknown.ts +15 -14
- package/src/unknown/is_unknown.ts +15 -14
- package/src/unknown/not_unknown_or.ts +1 -1
- package/src/utils/Widen.ts +9 -2
- package/src/utils/excessive.ts +11 -0
- package/src/{type → utils}/no_infer.ts +13 -7
- package/src/utils/readme.md +17 -0
- package/src/void/is_not_void.ts +20 -10
- package/src/void/is_void.ts +20 -10
- package/cjs/any/any.d.ts +0 -49
- package/cjs/any/any.d.ts.map +0 -1
- package/cjs/any/any.js.map +0 -1
- package/cjs/binary/Bit.d.ts +0 -6
- package/cjs/binary/Bit.d.ts.map +0 -1
- package/cjs/binary/Bit.js.map +0 -1
- package/cjs/binary/index.d.ts +0 -3
- package/cjs/binary/index.d.ts.map +0 -1
- package/cjs/binary/index.js +0 -6
- package/cjs/binary/index.js.map +0 -1
- package/cjs/never/never.d.ts +0 -75
- package/cjs/never/never.d.ts.map +0 -1
- package/cjs/never/never.js.map +0 -1
- package/cjs/predicates/logical.d.ts +0 -5
- package/cjs/predicates/logical.d.ts.map +0 -1
- package/cjs/type/failed.d.ts.map +0 -1
- package/cjs/type/no_infer.d.ts.map +0 -1
- package/cjs/type_plus/$equality.d.ts +0 -12
- package/cjs/type_plus/$equality.d.ts.map +0 -1
- package/cjs/type_plus/$equality.js +0 -3
- package/cjs/type_plus/$equality.js.map +0 -1
- package/cjs/type_plus/$error.d.ts +0 -8
- package/cjs/type_plus/$error.d.ts.map +0 -1
- package/cjs/type_plus/$infer_error.d.ts.map +0 -1
- package/cjs/type_plus/$infer_error.js.map +0 -1
- package/cjs/type_plus/$merge_options.d.ts +0 -11
- package/cjs/type_plus/$merge_options.d.ts.map +0 -1
- package/cjs/type_plus/$merge_options.js.map +0 -1
- package/cjs/type_plus/$resolve_options.d.ts.map +0 -1
- package/cjs/type_plus/$resolve_options.js.map +0 -1
- package/cjs/type_plus/$special_type.d.ts +0 -19
- package/cjs/type_plus/$special_type.d.ts.map +0 -1
- package/cjs/type_plus/$special_type.js +0 -3
- package/cjs/type_plus/$special_type.js.map +0 -1
- package/cjs/type_plus/$type.d.ts +0 -11
- package/cjs/type_plus/$type.d.ts.map +0 -1
- package/cjs/type_plus/branch/$branch.d.ts.map +0 -1
- package/cjs/type_plus/branch/$branch.js.map +0 -1
- package/cjs/type_plus/branch/$distributive.d.ts +0 -19
- package/cjs/type_plus/branch/$distributive.d.ts.map +0 -1
- package/cjs/type_plus/branch/$distributive.js.map +0 -1
- package/cjs/type_plus/branch/$exact.d.ts +0 -21
- package/cjs/type_plus/branch/$exact.d.ts.map +0 -1
- package/cjs/type_plus/branch/$input_options.d.ts.map +0 -1
- package/cjs/type_plus/branch/$input_options.js.map +0 -1
- package/cjs/type_plus/branch/$is_distributive.d.ts +0 -6
- package/cjs/type_plus/branch/$is_distributive.d.ts.map +0 -1
- package/cjs/type_plus/branch/$is_distributive.js +0 -3
- package/cjs/type_plus/branch/$is_distributive.js.map +0 -1
- package/cjs/type_plus/branch/$override.d.ts +0 -21
- package/cjs/type_plus/branch/$override.d.ts.map +0 -1
- package/cjs/type_plus/branch/$override.js +0 -3
- package/cjs/type_plus/branch/$override.js.map +0 -1
- package/cjs/type_plus/branch/$resolve_branch.d.ts +0 -29
- package/cjs/type_plus/branch/$resolve_branch.d.ts.map +0 -1
- package/cjs/type_plus/branch/$resolve_branch.js.map +0 -1
- package/cjs/type_plus/branch/$select.d.ts +0 -77
- package/cjs/type_plus/branch/$select.d.ts.map +0 -1
- package/cjs/type_plus/branch/$select.js +0 -3
- package/cjs/type_plus/branch/$select.js.map +0 -1
- package/cjs/type_plus/branch/$select_invert.d.ts +0 -75
- package/cjs/type_plus/branch/$select_invert.d.ts.map +0 -1
- package/cjs/type_plus/branch/$select_invert.js +0 -3
- package/cjs/type_plus/branch/$select_invert.js.map +0 -1
- package/cjs/type_plus/branch/$select_invert_strict.d.ts +0 -75
- package/cjs/type_plus/branch/$select_invert_strict.d.ts.map +0 -1
- package/cjs/type_plus/branch/$select_invert_strict.js +0 -3
- package/cjs/type_plus/branch/$select_invert_strict.js.map +0 -1
- package/cjs/type_plus/branch/$select_strict.d.ts +0 -76
- package/cjs/type_plus/branch/$select_strict.d.ts.map +0 -1
- package/cjs/type_plus/branch/$select_strict.js +0 -3
- package/cjs/type_plus/branch/$select_strict.js.map +0 -1
- package/cjs/type_plus/branch/$selection.d.ts +0 -127
- package/cjs/type_plus/branch/$selection.d.ts.map +0 -1
- package/cjs/type_plus/branch/$selection.js.map +0 -1
- package/cjs/type_plus/branch/$selection_options.d.ts +0 -37
- package/cjs/type_plus/branch/$selection_options.d.ts.map +0 -1
- package/cjs/type_plus/branch/$selection_options.js +0 -3
- package/cjs/type_plus/branch/$selection_options.js.map +0 -1
- package/cjs/unknown/unknown.d.ts +0 -55
- package/cjs/unknown/unknown.d.ts.map +0 -1
- package/cjs/unknown/unknown.js +0 -3
- package/cjs/unknown/unknown.js.map +0 -1
- package/esm/any/any.d.ts +0 -49
- package/esm/any/any.d.ts.map +0 -1
- package/esm/any/any.js +0 -2
- package/esm/any/any.js.map +0 -1
- package/esm/binary/Bit.d.ts +0 -6
- package/esm/binary/Bit.d.ts.map +0 -1
- package/esm/binary/Bit.js +0 -2
- package/esm/binary/Bit.js.map +0 -1
- package/esm/binary/index.d.ts +0 -3
- package/esm/binary/index.d.ts.map +0 -1
- package/esm/binary/index.js +0 -3
- package/esm/binary/index.js.map +0 -1
- package/esm/never/never.d.ts +0 -75
- package/esm/never/never.d.ts.map +0 -1
- package/esm/never/never.js +0 -2
- package/esm/never/never.js.map +0 -1
- package/esm/predicates/logical.d.ts +0 -5
- package/esm/predicates/logical.d.ts.map +0 -1
- package/esm/type/failed.d.ts.map +0 -1
- package/esm/type/no_infer.d.ts.map +0 -1
- package/esm/type_plus/$equality.d.ts +0 -12
- package/esm/type_plus/$equality.d.ts.map +0 -1
- package/esm/type_plus/$equality.js +0 -2
- package/esm/type_plus/$equality.js.map +0 -1
- package/esm/type_plus/$error.d.ts +0 -8
- package/esm/type_plus/$error.d.ts.map +0 -1
- package/esm/type_plus/$infer_error.d.ts.map +0 -1
- package/esm/type_plus/$infer_error.js.map +0 -1
- package/esm/type_plus/$merge_options.d.ts +0 -11
- package/esm/type_plus/$merge_options.d.ts.map +0 -1
- package/esm/type_plus/$merge_options.js.map +0 -1
- package/esm/type_plus/$resolve_options.d.ts.map +0 -1
- package/esm/type_plus/$resolve_options.js.map +0 -1
- package/esm/type_plus/$special_type.d.ts +0 -19
- package/esm/type_plus/$special_type.d.ts.map +0 -1
- package/esm/type_plus/$special_type.js +0 -2
- package/esm/type_plus/$special_type.js.map +0 -1
- package/esm/type_plus/$type.d.ts +0 -11
- package/esm/type_plus/$type.d.ts.map +0 -1
- package/esm/type_plus/branch/$branch.d.ts.map +0 -1
- package/esm/type_plus/branch/$branch.js.map +0 -1
- package/esm/type_plus/branch/$distributive.d.ts +0 -19
- package/esm/type_plus/branch/$distributive.d.ts.map +0 -1
- package/esm/type_plus/branch/$distributive.js.map +0 -1
- package/esm/type_plus/branch/$exact.d.ts +0 -21
- package/esm/type_plus/branch/$exact.d.ts.map +0 -1
- package/esm/type_plus/branch/$input_options.d.ts.map +0 -1
- package/esm/type_plus/branch/$input_options.js.map +0 -1
- package/esm/type_plus/branch/$is_distributive.d.ts +0 -6
- package/esm/type_plus/branch/$is_distributive.d.ts.map +0 -1
- package/esm/type_plus/branch/$is_distributive.js +0 -2
- package/esm/type_plus/branch/$is_distributive.js.map +0 -1
- package/esm/type_plus/branch/$override.d.ts +0 -21
- package/esm/type_plus/branch/$override.d.ts.map +0 -1
- package/esm/type_plus/branch/$override.js +0 -2
- package/esm/type_plus/branch/$override.js.map +0 -1
- package/esm/type_plus/branch/$resolve_branch.d.ts +0 -29
- package/esm/type_plus/branch/$resolve_branch.d.ts.map +0 -1
- package/esm/type_plus/branch/$resolve_branch.js.map +0 -1
- package/esm/type_plus/branch/$select.d.ts +0 -77
- package/esm/type_plus/branch/$select.d.ts.map +0 -1
- package/esm/type_plus/branch/$select.js +0 -2
- package/esm/type_plus/branch/$select.js.map +0 -1
- package/esm/type_plus/branch/$select_invert.d.ts +0 -75
- package/esm/type_plus/branch/$select_invert.d.ts.map +0 -1
- package/esm/type_plus/branch/$select_invert.js +0 -2
- package/esm/type_plus/branch/$select_invert.js.map +0 -1
- package/esm/type_plus/branch/$select_invert_strict.d.ts +0 -75
- package/esm/type_plus/branch/$select_invert_strict.d.ts.map +0 -1
- package/esm/type_plus/branch/$select_invert_strict.js +0 -2
- package/esm/type_plus/branch/$select_invert_strict.js.map +0 -1
- package/esm/type_plus/branch/$select_strict.d.ts +0 -76
- package/esm/type_plus/branch/$select_strict.d.ts.map +0 -1
- package/esm/type_plus/branch/$select_strict.js +0 -2
- package/esm/type_plus/branch/$select_strict.js.map +0 -1
- package/esm/type_plus/branch/$selection.d.ts +0 -127
- package/esm/type_plus/branch/$selection.d.ts.map +0 -1
- package/esm/type_plus/branch/$selection.js.map +0 -1
- package/esm/type_plus/branch/$selection_options.d.ts +0 -37
- package/esm/type_plus/branch/$selection_options.d.ts.map +0 -1
- package/esm/type_plus/branch/$selection_options.js +0 -2
- package/esm/type_plus/branch/$selection_options.js.map +0 -1
- package/esm/unknown/unknown.d.ts +0 -55
- package/esm/unknown/unknown.d.ts.map +0 -1
- package/esm/unknown/unknown.js +0 -2
- package/esm/unknown/unknown.js.map +0 -1
- package/src/any/any.ts +0 -46
- package/src/binary/Bit.ts +0 -6
- package/src/binary/index.ts +0 -2
- package/src/never/never.ts +0 -78
- package/src/predicates/logical.ts +0 -19
- package/src/type/readme.md +0 -36
- package/src/type_plus/$equality.ts +0 -12
- package/src/type_plus/$error.ts +0 -8
- package/src/type_plus/$merge_options.ts +0 -8
- package/src/type_plus/$special_type.ts +0 -26
- package/src/type_plus/$type.ts +0 -10
- package/src/type_plus/branch/$distributive.ts +0 -19
- package/src/type_plus/branch/$exact.ts +0 -28
- package/src/type_plus/branch/$is_distributive.ts +0 -15
- package/src/type_plus/branch/$override.ts +0 -22
- package/src/type_plus/branch/$resolve_branch.ts +0 -71
- package/src/type_plus/branch/$select.ts +0 -89
- package/src/type_plus/branch/$select_invert.ts +0 -83
- package/src/type_plus/branch/$select_invert_strict.ts +0 -83
- package/src/type_plus/branch/$select_strict.ts +0 -88
- package/src/type_plus/branch/$selection.ts +0 -134
- package/src/type_plus/branch/$selection_options.ts +0 -36
- package/src/type_plus/readme.md +0 -25
- package/src/unknown/unknown.ts +0 -57
- /package/cjs/{type_plus → $type}/$resolve_options.js +0 -0
- /package/cjs/{type_plus → $type}/$type.js +0 -0
- /package/cjs/{type_plus → $type}/branch/$branch.js +0 -0
- /package/cjs/{type_plus → $type}/branch/$input_options.js +0 -0
- /package/cjs/{type_plus → $type}/branch/$resolve_branch.js +0 -0
- /package/cjs/{type_plus → $type}/branch/$selection.js +0 -0
- /package/cjs/{type_plus/branch → $type/distributive}/$distributive.js +0 -0
- /package/cjs/{type_plus → $type/errors}/$error.js +0 -0
- /package/cjs/{type_plus → $type/errors}/$infer_error.js +0 -0
- /package/cjs/{type → $type/errors}/failed.js +0 -0
- /package/cjs/{type_plus/branch → $type/exact}/$exact.js +0 -0
- /package/cjs/{type_plus → $type/utils}/$merge_options.js +0 -0
- /package/cjs/{predicates → logical}/logical.js +0 -0
- /package/cjs/{type → utils}/no_infer.js +0 -0
- /package/esm/{type_plus → $type}/$resolve_options.js +0 -0
- /package/esm/{type_plus → $type}/$type.js +0 -0
- /package/esm/{type_plus → $type}/branch/$branch.js +0 -0
- /package/esm/{type_plus → $type}/branch/$input_options.js +0 -0
- /package/esm/{type_plus → $type}/branch/$resolve_branch.js +0 -0
- /package/esm/{type_plus → $type}/branch/$selection.js +0 -0
- /package/esm/{type_plus/branch → $type/distributive}/$distributive.js +0 -0
- /package/esm/{type_plus → $type/errors}/$error.js +0 -0
- /package/esm/{type_plus → $type/errors}/$infer_error.js +0 -0
- /package/esm/{type → $type/errors}/failed.js +0 -0
- /package/esm/{type_plus/branch → $type/exact}/$exact.js +0 -0
- /package/esm/{type_plus → $type/utils}/$merge_options.js +0 -0
- /package/esm/{predicates → logical}/logical.js +0 -0
- /package/esm/{type → utils}/no_infer.js +0 -0
package/readme.md
CHANGED
|
@@ -19,26 +19,26 @@ and type-level programming.
|
|
|
19
19
|
1. [Update organization](#update-organization)
|
|
20
20
|
2. [Update documentation](#update-documentation)
|
|
21
21
|
4. [Assertion Function](#assertion-function)
|
|
22
|
-
1. [assertType](#asserttype)
|
|
22
|
+
1. [`assertType`](#asserttype)
|
|
23
23
|
5. [Type Guard](#type-guard)
|
|
24
24
|
6. [Type Utilities](#type-utilities)
|
|
25
25
|
7. [Type Specific Utilities](#type-specific-utilities)
|
|
26
26
|
1. [any](#any)
|
|
27
27
|
2. [Array](#array)
|
|
28
|
-
3. [
|
|
29
|
-
4. [bigint](#bigint)
|
|
30
|
-
5. [
|
|
31
|
-
6. [
|
|
32
|
-
7. [
|
|
33
|
-
8. [
|
|
34
|
-
9. [
|
|
35
|
-
10. [
|
|
36
|
-
11. [
|
|
28
|
+
3. [Union](#union)
|
|
29
|
+
4. [`bigint`](#bigint)
|
|
30
|
+
5. [Boolean](#boolean)
|
|
31
|
+
6. [Function](#function)
|
|
32
|
+
7. [Never](#never)
|
|
33
|
+
8. [Null](#null)
|
|
34
|
+
9. [Number](#number)
|
|
35
|
+
10. [Numeric](#numeric)
|
|
36
|
+
11. [Object](#object)
|
|
37
37
|
12. [Promise](#promise)
|
|
38
|
-
13. [
|
|
39
|
-
14. [
|
|
40
|
-
15. [
|
|
41
|
-
16. [
|
|
38
|
+
13. [String](#string)
|
|
39
|
+
14. [Symbol](#symbol)
|
|
40
|
+
15. [Tuple](#tuple)
|
|
41
|
+
16. [Undefined](#undefined)
|
|
42
42
|
17. [unknown](#unknown)
|
|
43
43
|
18. [void](#void)
|
|
44
44
|
8. [Testing Utilities](#testing-utilities)
|
|
@@ -46,7 +46,7 @@ and type-level programming.
|
|
|
46
46
|
10. [JSON Support](#json-support)
|
|
47
47
|
11. [Type manipulation](#type-manipulation)
|
|
48
48
|
12. [Type Predicates](#type-predicates)
|
|
49
|
-
|
|
49
|
+
1. [Logical](#logical)
|
|
50
50
|
13. [Math](#math)
|
|
51
51
|
14. [Utility Functions](#utility-functions)
|
|
52
52
|
15. [Nominal Types](#nominal-types)
|
|
@@ -67,12 +67,12 @@ pnpm add type-plus
|
|
|
67
67
|
|
|
68
68
|
## What's in the package?
|
|
69
69
|
|
|
70
|
-
With over 200 types in [type-plus],
|
|
70
|
+
With over 200 types in [`type-plus`],
|
|
71
71
|
it can become difficult to find the types you need.
|
|
72
72
|
|
|
73
73
|
Also, some types need to be updated as TypeScript continue to evolve.
|
|
74
74
|
|
|
75
|
-
Currently, we are updating [type-plus] with the following objective:
|
|
75
|
+
Currently, we are updating [`type-plus`] with the following objective:
|
|
76
76
|
|
|
77
77
|
- Update organization
|
|
78
78
|
- Update documentation
|
|
@@ -81,7 +81,7 @@ Currently, we are updating [type-plus] with the following objective:
|
|
|
81
81
|
|
|
82
82
|
### Update organization
|
|
83
83
|
|
|
84
|
-
Top-level exports of [type-plus] will contain types and functions that do not expect the input to be a specific type. For example,
|
|
84
|
+
Top-level exports of [`type-plus`] will contain types and functions that do not expect the input to be a specific type. For example,
|
|
85
85
|
|
|
86
86
|
- `assertType()`, `isType()`, and `testType()`
|
|
87
87
|
- Type filters and predicates such as `AnyType` or `IsArray`
|
|
@@ -93,7 +93,7 @@ Other type specific utilities will be added under their respective `*Plus` names
|
|
|
93
93
|
|
|
94
94
|
### Update documentation
|
|
95
95
|
|
|
96
|
-
Each type and utility function in [type-plus] will be updated to include examples and tags to indicate its category and behavior.
|
|
96
|
+
Each type and utility function in [`type-plus`] will be updated to include examples and tags to indicate its category and behavior.
|
|
97
97
|
|
|
98
98
|
Each tag has an associated icon:
|
|
99
99
|
|
|
@@ -124,10 +124,10 @@ They throw an error if the condition is not met, and return nothing otherwise.
|
|
|
124
124
|
These assertion functions are typically used in runtime,
|
|
125
125
|
so that that type of the value can be narrowed down.
|
|
126
126
|
|
|
127
|
-
### assertType
|
|
127
|
+
### `assertType`
|
|
128
128
|
|
|
129
129
|
[`assertType`](./src/assertion/assert_type.ts) provides a generic assertion function,
|
|
130
|
-
as well as many assertion functions for
|
|
130
|
+
as well as many assertion functions for built-in types.
|
|
131
131
|
|
|
132
132
|
> [`assertType<T>(subject)`](./src/assertion/readme.md#asserttype)
|
|
133
133
|
|
|
@@ -275,7 +275,7 @@ This works similar to manual assertion `;(subject as T)`
|
|
|
275
275
|
|
|
276
276
|
> `Equal<A, B, Then = true, Else = false>`
|
|
277
277
|
|
|
278
|
-
💀 deprecated.
|
|
278
|
+
💀 deprecated. Use `IsEqual` instead. This will be converted to a ↪️ `parse`.
|
|
279
279
|
|
|
280
280
|
> `IsEqual<A, B, Then = true, Else = false>`
|
|
281
281
|
|
|
@@ -283,7 +283,7 @@ This works similar to manual assertion `;(subject as T)`
|
|
|
283
283
|
|
|
284
284
|
> `NotEqual<A, B, Then = true, Else = false>`
|
|
285
285
|
|
|
286
|
-
💀 deprecated.
|
|
286
|
+
💀 deprecated. Use `IsNotEqual` instead. This will be converted to a ↪️ `parse`.
|
|
287
287
|
|
|
288
288
|
> `IsNotEqual<A, B, Then = true, Else = false>`:
|
|
289
289
|
|
|
@@ -357,7 +357,7 @@ notA({ a: '' }) // TypeScript complains
|
|
|
357
357
|
|
|
358
358
|
## Type Specific Utilities
|
|
359
359
|
|
|
360
|
-
[type-plus](./README.md)
|
|
360
|
+
[`type-plus`](./README.md) provides type checking utilities for every type.
|
|
361
361
|
|
|
362
362
|
Each type has at least 4 type checks.
|
|
363
363
|
Using `string` as an example, there are `StringType<T>`, `IsString<T>`, `NotStringType<T>`, and `IsNotString<T>`.
|
|
@@ -399,7 +399,7 @@ You can learn more in their respective sections:
|
|
|
399
399
|
- 🌪️[`NotArrayType`](./src/array/readme.md#notarraytype): Filter `T` to ensure it is not an array, excluding tuple.
|
|
400
400
|
- 🎭[`IsNotArrayType`](./src/array/readme.md#isnotarraytype): Validate that `T` is not an array, excluding tuple.
|
|
401
401
|
- 🦴[`At`](./src/array/readme.md#at): Gets the type of the array or tuple at positive or negative index `N`.
|
|
402
|
-
- 🦴💀[`Concat`](./src/array/readme.md#concat):
|
|
402
|
+
- 🦴💀[`Concat`](./src/array/readme.md#concat): Concatenates two arrays or tuples.
|
|
403
403
|
- 🦴🔢[`FindFirst`](./src/array/readme.md#findfirst): Find the first type in the array or tuple `A` that matches `Criteria`.
|
|
404
404
|
- [`FindLast`](./src/array/readme.md#findlast)
|
|
405
405
|
- [`Some`](./src/array/readme.md#some)
|
|
@@ -425,12 +425,12 @@ You can learn more in their respective sections:
|
|
|
425
425
|
- [`ArrayPlus.SplitAt`](./src/array/readme.md#arrayplussplitat)
|
|
426
426
|
- [`ArrayPlus.Some`](./src/array/readme.md#arrayplussome)
|
|
427
427
|
|
|
428
|
-
### [
|
|
428
|
+
### [Union](./src/union/readme.md)
|
|
429
429
|
|
|
430
430
|
- [`IsUnion`](./src/union//readme.md#isunion)
|
|
431
431
|
- [`UnionType`](./src/union/readme.md#uniontype)
|
|
432
432
|
|
|
433
|
-
### bigint
|
|
433
|
+
### `bigint`
|
|
434
434
|
|
|
435
435
|
> [`BigintType<T, Then = T, Else = never>`](./src/bigint/bigint_type.ts#L15)
|
|
436
436
|
|
|
@@ -464,7 +464,7 @@ You can learn more in their respective sections:
|
|
|
464
464
|
|
|
465
465
|
⭕ `predicate`: if `T` is not exactly `bigint`.
|
|
466
466
|
|
|
467
|
-
###
|
|
467
|
+
### Boolean
|
|
468
468
|
|
|
469
469
|
> [`BooleanType<T>`](./src/boolean/readme.md#type-checking)
|
|
470
470
|
|
|
@@ -482,7 +482,7 @@ You can learn more in their respective sections:
|
|
|
482
482
|
|
|
483
483
|
⭕ `predicate`: `T !== boolean`
|
|
484
484
|
|
|
485
|
-
###
|
|
485
|
+
### Function
|
|
486
486
|
|
|
487
487
|
> [`FunctionType<T>`](./src/function/readme.md#type-checking)
|
|
488
488
|
|
|
@@ -516,7 +516,7 @@ You can learn more in their respective sections:
|
|
|
516
516
|
|
|
517
517
|
🔨 `utilities`: inspect a value and return it. Inspector defaults to `console.dir()`
|
|
518
518
|
|
|
519
|
-
###
|
|
519
|
+
### Never
|
|
520
520
|
|
|
521
521
|
> [`NeverType<T>`](./src/never/readme.md#type-checking)
|
|
522
522
|
|
|
@@ -534,7 +534,7 @@ You can learn more in their respective sections:
|
|
|
534
534
|
|
|
535
535
|
⭕ `predicate`: `T !== never`
|
|
536
536
|
|
|
537
|
-
###
|
|
537
|
+
### Null
|
|
538
538
|
|
|
539
539
|
> [`NullType<T>`](./src/null/readme.md#type-checking)
|
|
540
540
|
|
|
@@ -552,7 +552,7 @@ You can learn more in their respective sections:
|
|
|
552
552
|
|
|
553
553
|
⭕ `predicate`: `T !== null`
|
|
554
554
|
|
|
555
|
-
###
|
|
555
|
+
### Number
|
|
556
556
|
|
|
557
557
|
> [`NumberType<T, Then = N, Else = never>`](./src/number/number_type.ts#L14)
|
|
558
558
|
|
|
@@ -586,7 +586,7 @@ You can learn more in their respective sections:
|
|
|
586
586
|
|
|
587
587
|
⭕ `predicate`: is the type `T` not exactly `number`.
|
|
588
588
|
|
|
589
|
-
###
|
|
589
|
+
### Numeric
|
|
590
590
|
|
|
591
591
|
> [`Numeric`](./src/numeric/numeric_type.ts#L4)
|
|
592
592
|
|
|
@@ -648,7 +648,7 @@ You can learn more in their respective sections:
|
|
|
648
648
|
|
|
649
649
|
⭕ `predicate`: is not positive.
|
|
650
650
|
|
|
651
|
-
###
|
|
651
|
+
### Object
|
|
652
652
|
|
|
653
653
|
> `filterKey()`
|
|
654
654
|
|
|
@@ -686,7 +686,7 @@ You can learn more in their respective sections:
|
|
|
686
686
|
|
|
687
687
|
🔨 `utilities`: gets the value type `T`from `Record<any, T>`
|
|
688
688
|
|
|
689
|
-
[
|
|
689
|
+
[Video](https://www.youtube.com/watch?v=1J7xK6FUqPw).
|
|
690
690
|
|
|
691
691
|
> `reduceByKey()`
|
|
692
692
|
|
|
@@ -732,7 +732,7 @@ You can learn more in their respective sections:
|
|
|
732
732
|
🔨 `utilities`: Apply the `transformer` to the `value`.\
|
|
733
733
|
It is also exported under `MaybePromise.transform()`.
|
|
734
734
|
|
|
735
|
-
###
|
|
735
|
+
### String
|
|
736
736
|
|
|
737
737
|
> [`StringType<T>`](ts/string/readme.md#type-checking)
|
|
738
738
|
|
|
@@ -750,7 +750,7 @@ You can learn more in their respective sections:
|
|
|
750
750
|
|
|
751
751
|
⭕ `predicate`: is not `string`.
|
|
752
752
|
|
|
753
|
-
###
|
|
753
|
+
### Symbol
|
|
754
754
|
|
|
755
755
|
> [`SymbolType<T>`](ts/symbol/readme.md#type-checking)
|
|
756
756
|
|
|
@@ -768,12 +768,12 @@ You can learn more in their respective sections:
|
|
|
768
768
|
|
|
769
769
|
⭕ `predicate`: is not `symbol`.
|
|
770
770
|
|
|
771
|
-
###
|
|
771
|
+
### Tuple
|
|
772
772
|
|
|
773
773
|
- 🌪️ [`TupleType`](./src/tuple/readme.md#tupletype): Filter `T` to ensure it is a tuple, excluding array.
|
|
774
774
|
- 🎭 [`IsTuple`](./src/tuple/readme.md#istuple): Validate that `T` is a tuple, excluding array.
|
|
775
|
-
- 🌪️ [`NotTupleType`](./src/tuple/readme.md#nottupletype): Filter `T` to ensure it is not
|
|
776
|
-
- 🎭 [`IsNotTuple`](./src/tuple/readme.md#isnottupletype): Validate that `T` is not
|
|
775
|
+
- 🌪️ [`NotTupleType`](./src/tuple/readme.md#nottupletype): Filter `T` to ensure it is not a tuple, excluding array.
|
|
776
|
+
- 🎭 [`IsNotTuple`](./src/tuple/readme.md#isnottupletype): Validate that `T` is not a tuple, excluding array.
|
|
777
777
|
- ⚗️🔢[`CommonPropKeys`](./src/tuple/readme.md#commonpropkeys): Gets the common property keys of the elements in tuple `T`.
|
|
778
778
|
- ⚗️💀`CommonKeys`: Deprecated. Please use `CommonPropKeys` instead.
|
|
779
779
|
- ⚗️🔢[`DropFirst`](./src/tuple/readme.md#dropfirst): Drops the first entry in the tuple`T`.
|
|
@@ -795,7 +795,7 @@ You can learn more in their respective sections:
|
|
|
795
795
|
|
|
796
796
|
🔨 `utilities`: drop undefined entries from array of tuple `A`.
|
|
797
797
|
|
|
798
|
-
###
|
|
798
|
+
### Undefined
|
|
799
799
|
|
|
800
800
|
> [`UndefinedType<T>`](./src/undefined/readme.md#type-checking)
|
|
801
801
|
|
|
@@ -851,7 +851,7 @@ You can learn more in their respective sections:
|
|
|
851
851
|
|
|
852
852
|
## Testing Utilities
|
|
853
853
|
|
|
854
|
-
[type-plus](./README.md)
|
|
854
|
+
[`type-plus`](./README.md) provides some testing utilities to help you test your types.
|
|
855
855
|
|
|
856
856
|
One of the key utilities is [`testType`](./src/testing/readme.md#testtype).
|
|
857
857
|
|
|
@@ -933,7 +933,7 @@ JSONTypes.get<string>(someJson, 'a', 'b', 1, 'c') // miku
|
|
|
933
933
|
|
|
934
934
|
> `EitherAnd<A, B, [C, D]>`
|
|
935
935
|
|
|
936
|
-
💀🔨 `deprecated`,`utilities`: Renamed to `EitherOrBoth`.
|
|
936
|
+
💀🔨 `deprecated`,`utilities`: Renamed to `EitherOrBoth`. Combines 2 to 4 types as `A | B | (A & B)`.
|
|
937
937
|
|
|
938
938
|
This is useful for combining options.
|
|
939
939
|
|
|
@@ -1050,7 +1050,7 @@ They can be used to compose complex types.
|
|
|
1050
1050
|
|
|
1051
1051
|
> `IsAny<T>`
|
|
1052
1052
|
|
|
1053
|
-
🔨 `utilities`: `T === any
|
|
1053
|
+
🔨 `utilities`: `T === any`.
|
|
1054
1054
|
|
|
1055
1055
|
> `IsBoolean<T>`
|
|
1056
1056
|
|
|
@@ -1238,7 +1238,7 @@ overrider(source, { foo: !!source.foo })
|
|
|
1238
1238
|
🔨 `utilities`: a context builder.
|
|
1239
1239
|
|
|
1240
1240
|
This is useful to build context for functional programming.
|
|
1241
|
-
It is a sync version of the `AsyncContext` from [async-fp](https://unional/async-fp).
|
|
1241
|
+
It is a sync version of the `AsyncContext` from [`async-fp`](https://unional/async-fp).
|
|
1242
1242
|
|
|
1243
1243
|
```ts
|
|
1244
1244
|
import { context } from 'type-plus'
|
|
@@ -1332,45 +1332,45 @@ Whenever possible, I add attribution to the person who created those **codes** i
|
|
|
1332
1332
|
|
|
1333
1333
|
## Similar projects
|
|
1334
1334
|
|
|
1335
|
-
- [expect-type]: Compile-time tests for types
|
|
1336
|
-
- [hotscript]: Higher-order TypeScript
|
|
1337
|
-
- [spec.ts]: write tests for your types!
|
|
1338
|
-
- [ts-calc]: compute with typescript type system, part of [hotscript]
|
|
1339
|
-
- [ts-essentials]: all essential TypeScript types in one place.
|
|
1340
|
-
- [ts-expect]: Checks values in TypeScript match expectations.
|
|
1341
|
-
- [ts-toolbelt]: TypeScript's largest utility library.
|
|
1342
|
-
- [type-fest]: a collection of essential TypeScript types.
|
|
1343
|
-
- [type-zoo]: a modest type lib usable today.
|
|
1344
|
-
- [typepark]: a new type collection offering tuple manipulation and `Pipe`.
|
|
1345
|
-
- [typelevel-ts]: a type lib by [@gcanti], author of several FP libraries in TS.
|
|
1346
|
-
- [typical]: a playground of type-level operations for TypeScript.
|
|
1347
|
-
- [utility-types]: collection of utility types, complementing TypeScript
|
|
1348
|
-
- [earl]: Ergonomic, modern and type-safe assertion library for TypeScript
|
|
1335
|
+
- [`expect-type`]: Compile-time tests for types
|
|
1336
|
+
- [`hotscript`]: Higher-order TypeScript
|
|
1337
|
+
- [`spec.ts`]: write tests for your types!
|
|
1338
|
+
- [`ts-calc`]: compute with typescript type system, part of [`hotscript`]
|
|
1339
|
+
- [`ts-essentials`]: all essential TypeScript types in one place.
|
|
1340
|
+
- [`ts-expect`]: Checks values in TypeScript match expectations.
|
|
1341
|
+
- [`ts-toolbelt`]: TypeScript's largest utility library.
|
|
1342
|
+
- [`type-fest`]: a collection of essential TypeScript types.
|
|
1343
|
+
- [`type-zoo`]: a modest type lib usable today.
|
|
1344
|
+
- [`typepark`]: a new type collection offering tuple manipulation and `Pipe`.
|
|
1345
|
+
- [`typelevel-ts`]: a type lib by [@gcanti], author of several FP libraries in TS.
|
|
1346
|
+
- [`typical`]: a playground of type-level operations for TypeScript.
|
|
1347
|
+
- [`utility-types`]: collection of utility types, complementing TypeScript built-in mapped types and aliases.
|
|
1348
|
+
- [`earl`]: Ergonomic, modern and type-safe assertion library for TypeScript
|
|
1349
1349
|
|
|
1350
1350
|
[@gcanti]: https://github.com/gcanti
|
|
1351
1351
|
[codecov_image]: https://codecov.io/gh/unional/type-plus/branch/master/graph/badge.svg
|
|
1352
1352
|
[codecov_url]: https://codecov.io/gh/unional/type-plus
|
|
1353
1353
|
[downloads_image]: https://img.shields.io/npm/dm/type-plus.svg?style=flat
|
|
1354
|
-
[earl]: https://github.com/l2beat/earl
|
|
1355
|
-
[expect-type]: https://github.com/mmkal/expect-type
|
|
1354
|
+
[`earl`]: https://github.com/l2beat/earl
|
|
1355
|
+
[`expect-type`]: https://github.com/mmkal/expect-type
|
|
1356
1356
|
[github_action_url]: https://github.com/unional/type-plus/actions
|
|
1357
1357
|
[github_release]: https://github.com/unional/type-plus/workflows/release/badge.svg
|
|
1358
|
-
[hotscript]: https://github.com/gvergnaud/hotscript
|
|
1358
|
+
[`hotscript`]: https://github.com/gvergnaud/hotscript
|
|
1359
1359
|
[npm_image]: https://img.shields.io/npm/v/type-plus.svg?style=flat
|
|
1360
1360
|
[npm_url]: https://npmjs.org/package/type-plus
|
|
1361
|
-
[spec.ts]: https://github.com/aleclarson/spec.ts
|
|
1362
|
-
[ts-calc]: https://github.com/ecyrbe/ts-calc
|
|
1363
|
-
[ts-essentials]: https://github.com/ts-essentials/ts-essentials
|
|
1364
|
-
[ts-expect]: https://github.com/TypeStrong/ts-expect
|
|
1365
|
-
[ts-toolbelt]: https://github.com/millsp/ts-toolbelt
|
|
1366
|
-
[type-fest]: https://github.com/sindresorhus/type-fest
|
|
1367
|
-
[type-plus]: https://github.com/unional/type-plus
|
|
1368
|
-
[type-zoo]: https://github.com/pelotom/type-zoo
|
|
1369
|
-
[typelevel-ts]: https://github.com/gcanti/typelevel-ts
|
|
1370
|
-
[typepark]: https://github.com/kgtkr/typepark
|
|
1361
|
+
[`spec.ts`]: https://github.com/aleclarson/spec.ts
|
|
1362
|
+
[`ts-calc`]: https://github.com/ecyrbe/ts-calc
|
|
1363
|
+
[`ts-essentials`]: https://github.com/ts-essentials/ts-essentials
|
|
1364
|
+
[`ts-expect`]: https://github.com/TypeStrong/ts-expect
|
|
1365
|
+
[`ts-toolbelt`]: https://github.com/millsp/ts-toolbelt
|
|
1366
|
+
[`type-fest`]: https://github.com/sindresorhus/type-fest
|
|
1367
|
+
[`type-plus`]: https://github.com/unional/type-plus
|
|
1368
|
+
[`type-zoo`]: https://github.com/pelotom/type-zoo
|
|
1369
|
+
[`typelevel-ts`]: https://github.com/gcanti/typelevel-ts
|
|
1370
|
+
[`typepark`]: https://github.com/kgtkr/typepark
|
|
1371
1371
|
[TypeScript]: https://www.typescriptlang.org
|
|
1372
|
-
[typical]: https://github.com/KiaraGrouwstra/typical
|
|
1373
|
-
[utility-types]: https://github.com/piotrwitek/utility-types
|
|
1372
|
+
[`typical`]: https://github.com/KiaraGrouwstra/typical
|
|
1373
|
+
[`utility-types`]: https://github.com/piotrwitek/utility-types
|
|
1374
1374
|
[vscode_image]: https://img.shields.io/badge/vscode-ready-green.svg
|
|
1375
1375
|
[vscode_url]: https://code.visualstudio.com/
|
|
1376
1376
|
[assertion_functions]: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { $InferError } from '
|
|
1
|
+
import type { $InferError } from './errors/$infer_error.js'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 🧰 *type util*
|
|
@@ -13,5 +13,7 @@ export type $ResolveOptions<V extends unknown[]> = V extends [infer T]
|
|
|
13
13
|
: V extends [infer T, ...infer U]
|
|
14
14
|
? [T, unknown] extends [unknown, T]
|
|
15
15
|
? $ResolveOptions<U>
|
|
16
|
-
: T
|
|
16
|
+
: [T] extends [undefined]
|
|
17
|
+
? $ResolveOptions<U>
|
|
18
|
+
: T
|
|
17
19
|
: $InferError<'cannot [infer T, ...infer U] from', V>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A branded type to define unique types for type-level programming.
|
|
3
|
+
*
|
|
4
|
+
* It supports all primitive types and object types.
|
|
5
|
+
*
|
|
6
|
+
* When using object types, the type intersect with the specified type to give easy access to its properties.
|
|
7
|
+
*
|
|
8
|
+
* Internally, it uses the properties `_$type` and `_$value` to store the type and value.
|
|
9
|
+
* The type you provide should avoid specifying these properties.
|
|
10
|
+
*
|
|
11
|
+
* If needed, use `$O: { bare: true }` to avoid the intersection.
|
|
12
|
+
*
|
|
13
|
+
* @type V value
|
|
14
|
+
* @type $O options
|
|
15
|
+
*
|
|
16
|
+
* @since 8.0.0
|
|
17
|
+
*/
|
|
18
|
+
export type $Type<T extends string, V = unknown, $O extends { bare: true } | unknown = unknown> = $O extends {
|
|
19
|
+
bare: true
|
|
20
|
+
}
|
|
21
|
+
? $Type.$<T, V>
|
|
22
|
+
: [V] extends [null] | [undefined] | [symbol] | [void]
|
|
23
|
+
? $Type.$<T, V>
|
|
24
|
+
: $Type.$<T, V> & V
|
|
25
|
+
|
|
26
|
+
declare const _$type: '_$type'
|
|
27
|
+
declare const _$value: '_$value'
|
|
28
|
+
|
|
29
|
+
export namespace $Type {
|
|
30
|
+
export type $TypeKey = '_$type'
|
|
31
|
+
export type $ValueKey = '_$value'
|
|
32
|
+
|
|
33
|
+
export type $<T extends string, V = unknown> = {
|
|
34
|
+
[_$type]: T
|
|
35
|
+
[_$value]: V
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -12,7 +12,7 @@ import type { $Type } from '../$type.js'
|
|
|
12
12
|
* type $Then = $Branch<'$then'>
|
|
13
13
|
* type $Any = $Branch<'$any'>
|
|
14
14
|
*/
|
|
15
|
-
export type $Branch<P extends `$${string}`> = $Type<'branch', P
|
|
15
|
+
export type $Branch<P extends `$${string}`> = $Type<'branch', P>
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* 🧰 *type util*
|
|
@@ -23,4 +23,6 @@ export type $Branch<P extends `$${string}`> = $Type<'branch', P, P>
|
|
|
23
23
|
* type $YourOptions = $BranchOptions<$Then | $Else> // { $then: $Then, $else: $Else }
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
export type $BranchOptions<$B extends $Branch<any>> = {
|
|
26
|
+
export type $BranchOptions<$B extends $Branch<any>> = {
|
|
27
|
+
[k in $B[$Type.$ValueKey]]: $B extends { _$value: k } ? $B : never
|
|
28
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { $Type } from '../$type.js'
|
|
1
2
|
import type { $Branch } from './$branch.js'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -5,4 +6,4 @@ import type { $Branch } from './$branch.js'
|
|
|
5
6
|
*
|
|
6
7
|
* Define branch input options.
|
|
7
8
|
*/
|
|
8
|
-
export type $InputOptions<$B extends $Branch<any>> = { [k in $B[
|
|
9
|
+
export type $InputOptions<$B extends $Branch<any>> = { [k in $B[$Type.$ValueKey]]?: unknown }
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { $Type } from '../$type.js'
|
|
2
|
+
import type { $InferError } from '../errors/$infer_error.js'
|
|
3
|
+
import type { $Branch } from './$branch.js'
|
|
4
|
+
import type { $Else, $Then } from './$selection.js'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Resolve option value based on list of branches.
|
|
8
|
+
* It returns the first branch value that is specified in the option,
|
|
9
|
+
* otherwise will return the default value.
|
|
10
|
+
*
|
|
11
|
+
* Since this is an type utility,
|
|
12
|
+
* it does not perform extensive validations.
|
|
13
|
+
* Please check the description of each input below for information.
|
|
14
|
+
*
|
|
15
|
+
* @typeparam $O The input option. It should be a Record, not any, unknown, or never
|
|
16
|
+
* @typeparam $B Tuple of branches with at least one entry.
|
|
17
|
+
* @typeparam D Default value to return if no branch is found.
|
|
18
|
+
*/
|
|
19
|
+
export type $ResolveBranch<
|
|
20
|
+
$O extends Record<string, any>,
|
|
21
|
+
$Branches extends Array<$Branch<any> | unknown>,
|
|
22
|
+
D = unknown,
|
|
23
|
+
> = $Branches extends [infer B]
|
|
24
|
+
? _Last<$O, B, D>
|
|
25
|
+
: $Branches extends [infer B, ...infer Rest extends Array<$Branch<any> | unknown>]
|
|
26
|
+
? _<$O, B, $ResolveBranch<$O, Rest, D>>
|
|
27
|
+
: $InferError<'$Branches must have at least one entry'>
|
|
28
|
+
|
|
29
|
+
type _<$O extends Record<string, any>, $B, D> = $B extends $Branch<any>
|
|
30
|
+
? $B[$Type.$ValueKey] extends keyof $O
|
|
31
|
+
? $O[$B[$Type.$ValueKey]]
|
|
32
|
+
: D
|
|
33
|
+
: D
|
|
34
|
+
type _Last<$O extends Record<string, any>, $B, D> = $B extends $Then
|
|
35
|
+
? '$then' extends keyof $O
|
|
36
|
+
? $O['$then']
|
|
37
|
+
: $O['selection'] extends 'filter'
|
|
38
|
+
? D
|
|
39
|
+
: true
|
|
40
|
+
: $B extends $Else
|
|
41
|
+
? '$else' extends keyof $O
|
|
42
|
+
? $O['$else']
|
|
43
|
+
: $O['selection'] extends 'filter'
|
|
44
|
+
? never
|
|
45
|
+
: false
|
|
46
|
+
: _<$O, $B, D>
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import type { $Branch } from './$branch.js'
|
|
2
|
+
|
|
3
|
+
export type $Then = $Branch<'$then'>
|
|
4
|
+
export type $Else = $Branch<'$else'>
|
|
5
|
+
|
|
6
|
+
declare const $then: '$then'
|
|
7
|
+
declare const $else: '$else'
|
|
8
|
+
|
|
9
|
+
export namespace $Then {
|
|
10
|
+
export type $Key = '$then'
|
|
11
|
+
export type $Branch = {
|
|
12
|
+
[$then]: $Then
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export namespace $Else {
|
|
17
|
+
export type $Key = '$else'
|
|
18
|
+
export type $Branch = {
|
|
19
|
+
[$else]: $Else
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export namespace $Selection {
|
|
24
|
+
/**
|
|
25
|
+
* Options for selection (if-then-else) logic.
|
|
26
|
+
*
|
|
27
|
+
* The word "selection" refers to the basic elements in structural programming:
|
|
28
|
+
* sequence, selection, and iteration.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* type YourType<
|
|
33
|
+
* T,
|
|
34
|
+
* $Options extends YourType.$Options = YourType.$Branch
|
|
35
|
+
* > = ...
|
|
36
|
+
*
|
|
37
|
+
* namespace YourType {
|
|
38
|
+
* export type $Options = $SelectionOptions
|
|
39
|
+
* export type $Branch = $SelectionBranch
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export type Options = {
|
|
44
|
+
/**
|
|
45
|
+
* Specifies which default selection logic to use.
|
|
46
|
+
*
|
|
47
|
+
* `filter` returns `T` when the condition is met,
|
|
48
|
+
* and returns `never` otherwise.
|
|
49
|
+
*
|
|
50
|
+
* `predicate` returns boolean depends on the condition.
|
|
51
|
+
*
|
|
52
|
+
* Note that setting `$then` and `$else` overrides the default selection logic.
|
|
53
|
+
*/
|
|
54
|
+
selection?: 'predicate' | 'filter' | undefined
|
|
55
|
+
$then?: unknown
|
|
56
|
+
$else?: unknown
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type $BaseOptions = {
|
|
60
|
+
$then?: unknown
|
|
61
|
+
$else?: unknown
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Invert the selection branch.
|
|
66
|
+
*
|
|
67
|
+
* i.e.
|
|
68
|
+
* - `$Then` -> `$Else`
|
|
69
|
+
* - `$Else` -> `$Then`
|
|
70
|
+
*/
|
|
71
|
+
export type Invert<Branch extends $Then | $Else> = Branch extends $Then ? $Else : $Then
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Branch option for selection logic.
|
|
75
|
+
* It allows finely customizing the behavior of your type.
|
|
76
|
+
*
|
|
77
|
+
* Using this as the default value of your `$Options` is the recommended best practice.
|
|
78
|
+
*
|
|
79
|
+
* This encourage consumer of your type to use conditional type to avoid performance issues.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* type YourType<
|
|
84
|
+
* T,
|
|
85
|
+
* $Options extends YourType.$Options = YourType.$Branch
|
|
86
|
+
* > = ...
|
|
87
|
+
*
|
|
88
|
+
* namespace YourType {
|
|
89
|
+
* export type $Options = $SelectionOptions
|
|
90
|
+
* export type $Branch = $SelectionBranch
|
|
91
|
+
* }
|
|
92
|
+
*
|
|
93
|
+
* type R = YourType<T> extends infer R
|
|
94
|
+
* ? R extends $Then ? HandleThen
|
|
95
|
+
* : R extends $Else ? HandleElse
|
|
96
|
+
* : never
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
export type Branch<$O extends $Selection.Options = {}> = {
|
|
100
|
+
[$then]: $Then
|
|
101
|
+
[$else]: $Else
|
|
102
|
+
} & $O
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Default Options for filter selection logic.
|
|
106
|
+
*
|
|
107
|
+
* `filter` means the logic returns `T` when the condition is met,
|
|
108
|
+
* and returns `never` otherwise.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* type YourType<
|
|
113
|
+
* T,
|
|
114
|
+
* Options extends YourType.$Options = YourType.$Default> = ...
|
|
115
|
+
*
|
|
116
|
+
* namespace YourType {
|
|
117
|
+
* export type $Options = $SelectionOptions
|
|
118
|
+
* export type $Default = $SelectionFilter
|
|
119
|
+
* }
|
|
120
|
+
*
|
|
121
|
+
* type R = YourType<ThenType> // ThenType
|
|
122
|
+
* type X = YourType<ElseType> // never
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export type Filter<T> = {
|
|
126
|
+
selection: 'filter'
|
|
127
|
+
[$then]: T
|
|
128
|
+
[$else]: never
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Default Options for predicate selection logic.
|
|
133
|
+
*
|
|
134
|
+
* `predicate` means the logic returns `true` or `false` depending on the condition.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* type YourType<
|
|
139
|
+
* T,
|
|
140
|
+
* Options extends YourType.$Options = YourType.$Default> = ...
|
|
141
|
+
*
|
|
142
|
+
* namespace YourType {
|
|
143
|
+
* export type $Options = $SelectionOptions
|
|
144
|
+
* export type $Default = $SelectionPredicate
|
|
145
|
+
* }
|
|
146
|
+
*
|
|
147
|
+
* type R = YourType<ThenType> // true
|
|
148
|
+
* type X = YourType<ElseType> // false
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
export type Predicate = {
|
|
152
|
+
[$then]: true
|
|
153
|
+
[$else]: false
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Flip the selection options.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```ts
|
|
161
|
+
* type IsBoolean<T, $Options = $SelectionOptions> = ...
|
|
162
|
+
*
|
|
163
|
+
* type IsNotBoolean<T, $Options = $SelectionOptions> = IsBoolean<T, $FlipSelection<$Options>>
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
export type Flip<$Options extends $Selection.Options> = {
|
|
167
|
+
[$then]: $Options['$else']
|
|
168
|
+
[$else]: $Options['$then']
|
|
169
|
+
} & Omit<$Options, '$then' | '$else'>
|
|
170
|
+
}
|