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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { $InferError } from '
|
|
1
|
+
import type { $InferError } from './errors/$infer_error.js';
|
|
2
2
|
/**
|
|
3
3
|
* 🧰 *type util*
|
|
4
4
|
*
|
|
@@ -7,5 +7,5 @@ import type { $InferError } from './$infer_error.js';
|
|
|
7
7
|
* The `Values` are assumed to be a tuple with at least one value.
|
|
8
8
|
* These checks are not performed for performance considerations.
|
|
9
9
|
*/
|
|
10
|
-
export type $ResolveOptions<V extends unknown[]> = V extends [infer T] ? T : V extends [infer T, ...infer U] ? [T, unknown] extends [unknown, T] ? $ResolveOptions<U> : T : $InferError<'cannot [infer T, ...infer U] from', V>;
|
|
10
|
+
export type $ResolveOptions<V extends unknown[]> = V extends [infer T] ? T : V extends [infer T, ...infer U] ? [T, unknown] extends [unknown, T] ? $ResolveOptions<U> : [T] extends [undefined] ? $ResolveOptions<U> : T : $InferError<'cannot [infer T, ...infer U] from', V>;
|
|
11
11
|
//# sourceMappingURL=$resolve_options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$resolve_options.d.ts","sourceRoot":"","sources":["../../src/$type/$resolve_options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAE3D;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GACnE,CAAC,GACD,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,GAC9B,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,GAChC,eAAe,CAAC,CAAC,CAAC,GAClB,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,GACtB,eAAe,CAAC,CAAC,CAAC,GAClB,CAAC,GACH,WAAW,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$resolve_options.js","sourceRoot":"","sources":["../../src/$type/$resolve_options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 {
|
|
19
|
+
bare: true;
|
|
20
|
+
} | unknown = unknown> = $O extends {
|
|
21
|
+
bare: true;
|
|
22
|
+
} ? $Type.$<T, V> : [V] extends [null] | [undefined] | [symbol] | [void] ? $Type.$<T, V> : $Type.$<T, V> & V;
|
|
23
|
+
declare const _$type: '_$type';
|
|
24
|
+
declare const _$value: '_$value';
|
|
25
|
+
export declare namespace $Type {
|
|
26
|
+
type $TypeKey = '_$type';
|
|
27
|
+
type $ValueKey = '_$value';
|
|
28
|
+
type $<T extends string, V = unknown> = {
|
|
29
|
+
[_$type]: T;
|
|
30
|
+
[_$value]: V;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=$type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$type.d.ts","sourceRoot":"","sources":["../../src/$type/$type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,GAAG,OAAO,EAAE,EAAE,SAAS;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GAAG,OAAO,GAAG,OAAO,IAAI,EAAE,SAAS;IAC5G,IAAI,EAAE,IAAI,CAAA;CACV,GACE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GACb,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GACnD,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GACb,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAA;AAErB,OAAO,CAAC,MAAM,MAAM,EAAE,QAAQ,CAAA;AAC9B,OAAO,CAAC,MAAM,OAAO,EAAE,SAAS,CAAA;AAEhC,yBAAiB,KAAK,CAAC;IACtB,KAAY,QAAQ,GAAG,QAAQ,CAAA;IAC/B,KAAY,SAAS,GAAG,SAAS,CAAA;IAEjC,KAAY,CAAC,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,GAAG,OAAO,IAAI;QAC9C,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QACX,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;KACZ,CAAA;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"$type.js","sourceRoot":"","sources":["../../src
|
|
1
|
+
{"version":3,"file":"$type.js","sourceRoot":"","sources":["../../src/$type/$type.ts"],"names":[],"mappings":""}
|
|
@@ -11,7 +11,7 @@ import type { $Type } from '../$type.js';
|
|
|
11
11
|
* type $Then = $Branch<'$then'>
|
|
12
12
|
* type $Any = $Branch<'$any'>
|
|
13
13
|
*/
|
|
14
|
-
export type $Branch<P extends `$${string}`> = $Type<'branch', P
|
|
14
|
+
export type $Branch<P extends `$${string}`> = $Type<'branch', P>;
|
|
15
15
|
/**
|
|
16
16
|
* 🧰 *type util*
|
|
17
17
|
*
|
|
@@ -22,8 +22,8 @@ export type $Branch<P extends `$${string}`> = $Type<'branch', P, P>;
|
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
24
|
export type $BranchOptions<$B extends $Branch<any>> = {
|
|
25
|
-
[k in $B[
|
|
26
|
-
value: k;
|
|
25
|
+
[k in $B[$Type.$ValueKey]]: $B extends {
|
|
26
|
+
_$value: k;
|
|
27
27
|
} ? $B : never;
|
|
28
28
|
};
|
|
29
29
|
//# sourceMappingURL=$branch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$branch.d.ts","sourceRoot":"","sources":["../../../src/$type/branch/$branch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,IAAI,MAAM,EAAE,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;AAEhE;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,CAAC,EAAE,SAAS,OAAO,CAAC,GAAG,CAAC,IAAI;KACpD,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS;QAAE,OAAO,EAAE,CAAC,CAAA;KAAE,GAAG,EAAE,GAAG,KAAK;CAClE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$branch.js","sourceRoot":"","sources":["../../../src/$type/branch/$branch.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { $Type } from '../$type.js';
|
|
1
2
|
import type { $Branch } from './$branch.js';
|
|
2
3
|
/**
|
|
3
4
|
* 🧰 *type util*
|
|
@@ -5,6 +6,6 @@ import type { $Branch } from './$branch.js';
|
|
|
5
6
|
* Define branch input options.
|
|
6
7
|
*/
|
|
7
8
|
export type $InputOptions<$B extends $Branch<any>> = {
|
|
8
|
-
[k in $B[
|
|
9
|
+
[k in $B[$Type.$ValueKey]]?: unknown;
|
|
9
10
|
};
|
|
10
11
|
//# sourceMappingURL=$input_options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$input_options.d.ts","sourceRoot":"","sources":["../../../src/$type/branch/$input_options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C;;;;GAIG;AACH,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,OAAO,CAAC,GAAG,CAAC,IAAI;KAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO;CAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$input_options.js","sourceRoot":"","sources":["../../../src/$type/branch/$input_options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
* Resolve option value based on list of branches.
|
|
7
|
+
* It returns the first branch value that is specified in the option,
|
|
8
|
+
* otherwise will return the default value.
|
|
9
|
+
*
|
|
10
|
+
* Since this is an type utility,
|
|
11
|
+
* it does not perform extensive validations.
|
|
12
|
+
* Please check the description of each input below for information.
|
|
13
|
+
*
|
|
14
|
+
* @typeparam $O The input option. It should be a Record, not any, unknown, or never
|
|
15
|
+
* @typeparam $B Tuple of branches with at least one entry.
|
|
16
|
+
* @typeparam D Default value to return if no branch is found.
|
|
17
|
+
*/
|
|
18
|
+
export type $ResolveBranch<$O extends Record<string, any>, $Branches extends Array<$Branch<any> | unknown>, D = unknown> = $Branches extends [infer B] ? _Last<$O, B, D> : $Branches extends [infer B, ...infer Rest extends Array<$Branch<any> | unknown>] ? _<$O, B, $ResolveBranch<$O, Rest, D>> : $InferError<'$Branches must have at least one entry'>;
|
|
19
|
+
type _<$O extends Record<string, any>, $B, D> = $B extends $Branch<any> ? $B[$Type.$ValueKey] extends keyof $O ? $O[$B[$Type.$ValueKey]] : D : D;
|
|
20
|
+
type _Last<$O extends Record<string, any>, $B, D> = $B extends $Then ? '$then' extends keyof $O ? $O['$then'] : $O['selection'] extends 'filter' ? D : true : $B extends $Else ? '$else' extends keyof $O ? $O['$else'] : $O['selection'] extends 'filter' ? never : false : _<$O, $B, D>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=$resolve_branch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$resolve_branch.d.ts","sourceRoot":"","sources":["../../../src/$type/branch/$resolve_branch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEnD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,CACzB,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,SAAS,SAAS,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,EAC/C,CAAC,GAAG,OAAO,IACR,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,GAC5B,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,GACf,SAAS,SAAS,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,IAAI,SAAS,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,GAC/E,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,cAAc,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,GACrC,WAAW,CAAC,wCAAwC,CAAC,CAAA;AAEzD,KAAK,CAAC,CAAC,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,SAAS,OAAO,CAAC,GAAG,CAAC,GACpE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,MAAM,EAAE,GACnC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GACvB,CAAC,GACF,CAAC,CAAA;AACJ,KAAK,KAAK,CAAC,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,GACjE,OAAO,SAAS,MAAM,EAAE,GACvB,EAAE,CAAC,OAAO,CAAC,GACX,EAAE,CAAC,WAAW,CAAC,SAAS,QAAQ,GAC/B,CAAC,GACD,IAAI,GACN,EAAE,SAAS,KAAK,GACf,OAAO,SAAS,MAAM,EAAE,GACvB,EAAE,CAAC,OAAO,CAAC,GACX,EAAE,CAAC,WAAW,CAAC,SAAS,QAAQ,GAC/B,KAAK,GACL,KAAK,GACP,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$resolve_branch.js","sourceRoot":"","sources":["../../../src/$type/branch/$resolve_branch.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import type { $Branch } from './$branch.js';
|
|
2
|
+
export type $Then = $Branch<'$then'>;
|
|
3
|
+
export type $Else = $Branch<'$else'>;
|
|
4
|
+
declare const $then: '$then';
|
|
5
|
+
declare const $else: '$else';
|
|
6
|
+
export declare namespace $Then {
|
|
7
|
+
type $Key = '$then';
|
|
8
|
+
type $Branch = {
|
|
9
|
+
[$then]: $Then;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare namespace $Else {
|
|
13
|
+
type $Key = '$else';
|
|
14
|
+
type $Branch = {
|
|
15
|
+
[$else]: $Else;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare namespace $Selection {
|
|
19
|
+
/**
|
|
20
|
+
* Options for selection (if-then-else) logic.
|
|
21
|
+
*
|
|
22
|
+
* The word "selection" refers to the basic elements in structural programming:
|
|
23
|
+
* sequence, selection, and iteration.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* type YourType<
|
|
28
|
+
* T,
|
|
29
|
+
* $Options extends YourType.$Options = YourType.$Branch
|
|
30
|
+
* > = ...
|
|
31
|
+
*
|
|
32
|
+
* namespace YourType {
|
|
33
|
+
* export type $Options = $SelectionOptions
|
|
34
|
+
* export type $Branch = $SelectionBranch
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
type Options = {
|
|
39
|
+
/**
|
|
40
|
+
* Specifies which default selection logic to use.
|
|
41
|
+
*
|
|
42
|
+
* `filter` returns `T` when the condition is met,
|
|
43
|
+
* and returns `never` otherwise.
|
|
44
|
+
*
|
|
45
|
+
* `predicate` returns boolean depends on the condition.
|
|
46
|
+
*
|
|
47
|
+
* Note that setting `$then` and `$else` overrides the default selection logic.
|
|
48
|
+
*/
|
|
49
|
+
selection?: 'predicate' | 'filter' | undefined;
|
|
50
|
+
$then?: unknown;
|
|
51
|
+
$else?: unknown;
|
|
52
|
+
};
|
|
53
|
+
type $BaseOptions = {
|
|
54
|
+
$then?: unknown;
|
|
55
|
+
$else?: unknown;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Invert the selection branch.
|
|
59
|
+
*
|
|
60
|
+
* i.e.
|
|
61
|
+
* - `$Then` -> `$Else`
|
|
62
|
+
* - `$Else` -> `$Then`
|
|
63
|
+
*/
|
|
64
|
+
type Invert<Branch extends $Then | $Else> = Branch extends $Then ? $Else : $Then;
|
|
65
|
+
/**
|
|
66
|
+
* Branch option for selection logic.
|
|
67
|
+
* It allows finely customizing the behavior of your type.
|
|
68
|
+
*
|
|
69
|
+
* Using this as the default value of your `$Options` is the recommended best practice.
|
|
70
|
+
*
|
|
71
|
+
* This encourage consumer of your type to use conditional type to avoid performance issues.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* type YourType<
|
|
76
|
+
* T,
|
|
77
|
+
* $Options extends YourType.$Options = YourType.$Branch
|
|
78
|
+
* > = ...
|
|
79
|
+
*
|
|
80
|
+
* namespace YourType {
|
|
81
|
+
* export type $Options = $SelectionOptions
|
|
82
|
+
* export type $Branch = $SelectionBranch
|
|
83
|
+
* }
|
|
84
|
+
*
|
|
85
|
+
* type R = YourType<T> extends infer R
|
|
86
|
+
* ? R extends $Then ? HandleThen
|
|
87
|
+
* : R extends $Else ? HandleElse
|
|
88
|
+
* : never
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
type Branch<$O extends $Selection.Options = {}> = {
|
|
92
|
+
[$then]: $Then;
|
|
93
|
+
[$else]: $Else;
|
|
94
|
+
} & $O;
|
|
95
|
+
/**
|
|
96
|
+
* Default Options for filter selection logic.
|
|
97
|
+
*
|
|
98
|
+
* `filter` means the logic returns `T` when the condition is met,
|
|
99
|
+
* and returns `never` otherwise.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* type YourType<
|
|
104
|
+
* T,
|
|
105
|
+
* Options extends YourType.$Options = YourType.$Default> = ...
|
|
106
|
+
*
|
|
107
|
+
* namespace YourType {
|
|
108
|
+
* export type $Options = $SelectionOptions
|
|
109
|
+
* export type $Default = $SelectionFilter
|
|
110
|
+
* }
|
|
111
|
+
*
|
|
112
|
+
* type R = YourType<ThenType> // ThenType
|
|
113
|
+
* type X = YourType<ElseType> // never
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
type Filter<T> = {
|
|
117
|
+
selection: 'filter';
|
|
118
|
+
[$then]: T;
|
|
119
|
+
[$else]: never;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Default Options for predicate selection logic.
|
|
123
|
+
*
|
|
124
|
+
* `predicate` means the logic returns `true` or `false` depending on the condition.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* type YourType<
|
|
129
|
+
* T,
|
|
130
|
+
* Options extends YourType.$Options = YourType.$Default> = ...
|
|
131
|
+
*
|
|
132
|
+
* namespace YourType {
|
|
133
|
+
* export type $Options = $SelectionOptions
|
|
134
|
+
* export type $Default = $SelectionPredicate
|
|
135
|
+
* }
|
|
136
|
+
*
|
|
137
|
+
* type R = YourType<ThenType> // true
|
|
138
|
+
* type X = YourType<ElseType> // false
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
type Predicate = {
|
|
142
|
+
[$then]: true;
|
|
143
|
+
[$else]: false;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Flip the selection options.
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* type IsBoolean<T, $Options = $SelectionOptions> = ...
|
|
151
|
+
*
|
|
152
|
+
* type IsNotBoolean<T, $Options = $SelectionOptions> = IsBoolean<T, $FlipSelection<$Options>>
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
type Flip<$Options extends $Selection.Options> = {
|
|
156
|
+
[$then]: $Options['$else'];
|
|
157
|
+
[$else]: $Options['$then'];
|
|
158
|
+
} & Omit<$Options, '$then' | '$else'>;
|
|
159
|
+
}
|
|
160
|
+
export {};
|
|
161
|
+
//# sourceMappingURL=$selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$selection.d.ts","sourceRoot":"","sources":["../../../src/$type/branch/$selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AACpC,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAEpC,OAAO,CAAC,MAAM,KAAK,EAAE,OAAO,CAAA;AAC5B,OAAO,CAAC,MAAM,KAAK,EAAE,OAAO,CAAA;AAE5B,yBAAiB,KAAK,CAAC;IACtB,KAAY,IAAI,GAAG,OAAO,CAAA;IAC1B,KAAY,OAAO,GAAG;QACrB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KACd,CAAA;CACD;AAED,yBAAiB,KAAK,CAAC;IACtB,KAAY,IAAI,GAAG,OAAO,CAAA;IAC1B,KAAY,OAAO,GAAG;QACrB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KACd,CAAA;CACD;AAED,yBAAiB,UAAU,CAAC;IAC3B;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAY,OAAO,GAAG;QACrB;;;;;;;;;WASG;QACH,SAAS,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAA;QAC9C,KAAK,CAAC,EAAE,OAAO,CAAA;QACf,KAAK,CAAC,EAAE,OAAO,CAAA;KACf,CAAA;IAED,KAAY,YAAY,GAAG;QAC1B,KAAK,CAAC,EAAE,OAAO,CAAA;QACf,KAAK,CAAC,EAAE,OAAO,CAAA;KACf,CAAA;IAED;;;;;;OAMG;IACH,KAAY,MAAM,CAAC,MAAM,SAAS,KAAK,GAAG,KAAK,IAAI,MAAM,SAAS,KAAK,GAAG,KAAK,GAAG,KAAK,CAAA;IAEvF;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,KAAY,MAAM,CAAC,EAAE,SAAS,UAAU,CAAC,OAAO,GAAG,EAAE,IAAI;QACxD,CAAC,KAAK,CAAC,EAAE,KAAK,CAAA;QACd,CAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KACd,GAAG,EAAE,CAAA;IAEN;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,KAAY,MAAM,CAAC,CAAC,IAAI;QACvB,SAAS,EAAE,QAAQ,CAAA;QACnB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QACV,CAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KACd,CAAA;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAY,SAAS,GAAG;QACvB,CAAC,KAAK,CAAC,EAAE,IAAI,CAAA;QACb,CAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KACd,CAAA;IAED;;;;;;;;;OASG;IACH,KAAY,IAAI,CAAC,QAAQ,SAAS,UAAU,CAAC,OAAO,IAAI;QACvD,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;QAC1B,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;KAC1B,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,CAAA;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$selection.js","sourceRoot":"","sources":["../../../src/$type/branch/$selection.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { $ResolveOptions } from '../$resolve_options.js';
|
|
2
|
+
import type { $InputOptions } from '../branch/$input_options.js';
|
|
3
|
+
import type { $Else, $Then } from '../branch/$selection.js';
|
|
4
|
+
export declare namespace $Distributive {
|
|
5
|
+
/**
|
|
6
|
+
* Options for controlling if the type is distributive.
|
|
7
|
+
*/
|
|
8
|
+
type Options = {
|
|
9
|
+
distributive?: boolean | undefined;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Default options for `distributive` behavior.
|
|
13
|
+
*
|
|
14
|
+
* By default it is `true`.
|
|
15
|
+
*/
|
|
16
|
+
type Default = {
|
|
17
|
+
distributive: true;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Parse the options for `distributive`.
|
|
21
|
+
*/
|
|
22
|
+
type Parse<$Options extends Options, $O extends $InputOptions<$Then | $Else> = {}> = $ResolveOptions<[
|
|
23
|
+
$Options['distributive'],
|
|
24
|
+
Default['distributive']
|
|
25
|
+
]> extends true ? '$then' extends keyof $O ? $O['$then'] : true : '$else' extends keyof $O ? $O['$else'] : false;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=$distributive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$distributive.d.ts","sourceRoot":"","sources":["../../../src/$type/distributive/$distributive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAE3D,yBAAiB,aAAa,CAAC;IAC9B;;OAEG;IACH,KAAY,OAAO,GAAG;QACrB,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAClC,CAAA;IAED;;;;OAIG;IACH,KAAY,OAAO,GAAG;QACrB,YAAY,EAAE,IAAI,CAAA;KAClB,CAAA;IAED;;OAEG;IACH,KAAY,KAAK,CAAC,QAAQ,SAAS,OAAO,EAAE,EAAE,SAAS,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,eAAe,CAC1G;QAAC,QAAQ,CAAC,cAAc,CAAC;QAAE,OAAO,CAAC,cAAc,CAAC;KAAC,CACnD,SAAS,IAAI,GACX,OAAO,SAAS,MAAM,EAAE,GACvB,EAAE,CAAC,OAAO,CAAC,GACX,IAAI,GACL,OAAO,SAAS,MAAM,EAAE,GACvB,EAAE,CAAC,OAAO,CAAC,GACX,KAAK,CAAA;CACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$distributive.js","sourceRoot":"","sources":["../../../src/$type/distributive/$distributive.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { $Type } from '../$type.js';
|
|
2
|
+
/**
|
|
3
|
+
* 🧰 *type util*
|
|
4
|
+
*
|
|
5
|
+
* A type-level error.
|
|
6
|
+
*
|
|
7
|
+
* This is analogous to the `Error` class in JavaScript.
|
|
8
|
+
*
|
|
9
|
+
* It can be used in type-level programming to represent an error with a message.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* type T = $Error<'error message'>
|
|
14
|
+
* type T = $Error<'error message', number>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @since 8.0.0
|
|
18
|
+
*/
|
|
19
|
+
export type $Error<M extends string, T = unknown> = M extends any ? $Type<'error', {
|
|
20
|
+
message: M;
|
|
21
|
+
type: T;
|
|
22
|
+
}> : never;
|
|
23
|
+
//# sourceMappingURL=$error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$error.d.ts","sourceRoot":"","sources":["../../../src/$type/errors/$error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,GAAG,OAAO,IAAI,CAAC,SAAS,GAAG,GAAG,KAAK,CAAC,OAAO,EAAE;IAAE,OAAO,EAAE,CAAC,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,GAAG,KAAK,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"$error.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"$error.js","sourceRoot":"","sources":["../../../src/$type/errors/$error.ts"],"names":[],"mappings":""}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import type { $
|
|
1
|
+
import type { $Error } from './$error.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* An error for unexpected failure of infer type.
|
|
3
|
+
* An error to indicate unexpected failure when inferring type.
|
|
6
4
|
*
|
|
7
5
|
* In your type,
|
|
8
6
|
* you can use `T extends infer U extends V` to specify the type of the inferred type `U`.
|
|
9
7
|
*
|
|
10
8
|
* But doing so means you have to do an extra conditional type.
|
|
11
9
|
*
|
|
12
|
-
* This type can be use in the else case to indicate unexpected failure
|
|
10
|
+
* This type can be use in the else case to indicate unexpected failure when inferring type.
|
|
13
11
|
*
|
|
12
|
+
* @example
|
|
14
13
|
* ```ts
|
|
15
14
|
* type F<T> = T extends infer U extends V
|
|
16
15
|
* ? ...your type logic...
|
|
17
16
|
* : InferError<'some message', T>
|
|
18
17
|
* ```
|
|
18
|
+
*
|
|
19
|
+
* @since 8.0.0
|
|
19
20
|
*/
|
|
20
|
-
export type $InferError<M extends string, T = unknown> = M extends any ? $
|
|
21
|
+
export type $InferError<M extends string, T = unknown> = M extends any ? $Error<`Unable to infer: ${M}`, T> : never;
|
|
21
22
|
//# sourceMappingURL=$infer_error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$infer_error.d.ts","sourceRoot":"","sources":["../../../src/$type/errors/$infer_error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,GAAG,OAAO,IAAI,CAAC,SAAS,GAAG,GAAG,MAAM,CAAC,oBAAoB,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$infer_error.js","sourceRoot":"","sources":["../../../src/$type/errors/$infer_error.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
declare const uniSym: unique symbol;
|
|
2
2
|
/**
|
|
3
|
+
* @deprecated **💀 deprecated since 8.0.0**: use `$Error` instead.
|
|
4
|
+
*
|
|
3
5
|
* A failed type with message.
|
|
4
6
|
*
|
|
5
7
|
* This is analogous to the `Error` class in JavaScript.
|
|
@@ -17,6 +19,8 @@ export interface Failed<Msg extends string> {
|
|
|
17
19
|
[uniSym]: Msg;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
22
|
+
* @deprecated **💀 deprecated since 8.0.0**: use `$Error` instead.
|
|
23
|
+
*
|
|
20
24
|
* A failed type with message and one additional type.
|
|
21
25
|
*
|
|
22
26
|
* Use this to add a generic type to the failed type.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failed.d.ts","sourceRoot":"","sources":["../../../src/$type/errors/failed.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,MAAM,EAAE,OAAO,MAAM,CAAA;AAEnC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,MAAM,CAAC,GAAG,SAAS,MAAM;IACzC,CAAC,MAAM,CAAC,EAAE,GAAG,CAAA;CACb;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,OAAO,CAAC,GAAG,SAAS,MAAM,EAAE,EAAE;IAC9C,CAAC,MAAM,CAAC,EAAE,GAAG,CAAA;CACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failed.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"failed.js","sourceRoot":"","sources":["../../../src/$type/errors/failed.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { $ResolveOptions } from '../$resolve_options.js';
|
|
2
|
+
import type { $InputOptions } from '../branch/$input_options.js';
|
|
3
|
+
import type { $Else, $Then } from '../branch/$selection.js';
|
|
4
|
+
export declare namespace $Exact {
|
|
5
|
+
/**
|
|
6
|
+
* Options for controlling if the type perform exact comparison.
|
|
7
|
+
*/
|
|
8
|
+
type Options = {
|
|
9
|
+
exact?: boolean | undefined;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Default options for `exact` behavior.
|
|
13
|
+
*
|
|
14
|
+
* By default it is `false`.
|
|
15
|
+
*/
|
|
16
|
+
type Default = {
|
|
17
|
+
exact: false;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Parse the options for `exact`.
|
|
21
|
+
*/
|
|
22
|
+
type Parse<$Options extends Options, $O extends $InputOptions<$Then | $Else> = {}> = $ResolveOptions<[
|
|
23
|
+
$Options['exact'],
|
|
24
|
+
Default['exact']
|
|
25
|
+
]> extends true ? '$then' extends keyof $O ? $O['$then'] : true : '$else' extends keyof $O ? $O['$else'] : false;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=$exact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$exact.d.ts","sourceRoot":"","sources":["../../../src/$type/exact/$exact.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAE3D,yBAAiB,MAAM,CAAC;IACvB;;OAEG;IACH,KAAY,OAAO,GAAG;QACrB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAC3B,CAAA;IAED;;;;OAIG;IACH,KAAY,OAAO,GAAG;QACrB,KAAK,EAAE,KAAK,CAAA;KACZ,CAAA;IAED;;OAEG;IACH,KAAY,KAAK,CAAC,QAAQ,SAAS,OAAO,EAAE,EAAE,SAAS,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,eAAe,CAC1G;QAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,CAAC,OAAO,CAAC;KAAC,CACrC,SAAS,IAAI,GACX,OAAO,SAAS,MAAM,EAAE,GACvB,EAAE,CAAC,OAAO,CAAC,GACX,IAAI,GACL,OAAO,SAAS,MAAM,EAAE,GACvB,EAAE,CAAC,OAAO,CAAC,GACX,KAAK,CAAA;CACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"$exact.js","sourceRoot":"","sources":["../../../src/
|
|
1
|
+
{"version":3,"file":"$exact.js","sourceRoot":"","sources":["../../../src/$type/exact/$exact.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { $Branch } from '../branch/$branch.js';
|
|
2
|
+
/**
|
|
3
|
+
* Branch selector for type `any`.
|
|
4
|
+
*/
|
|
5
|
+
export type $Any = $Branch<'$any'>;
|
|
6
|
+
declare const $any: '$any';
|
|
7
|
+
export declare namespace $Any {
|
|
8
|
+
type $Key = '$any';
|
|
9
|
+
/**
|
|
10
|
+
* Options to specifically handles the `any` type.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* type YourType<T, $Options extends $Any.$Options> = ...
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
type $Options = {
|
|
18
|
+
[$any]?: unknown;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Branch option to specifically handles the `any` type.
|
|
22
|
+
*
|
|
23
|
+
* Use this to finely customize the behavior of your type.
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* type YourType<T, $Options extends $Any.Options> = ...
|
|
27
|
+
*
|
|
28
|
+
* type R = YourType<T, $Any.$Branch> extends $Any ? HandleAny : HandleOthers
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
type $Branch = {
|
|
32
|
+
[$any]: $Any;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=$any.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$any.d.ts","sourceRoot":"","sources":["../../../src/$type/special/$any.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAElC,OAAO,CAAC,MAAM,IAAI,EAAE,MAAM,CAAA;AAE1B,yBAAiB,IAAI,CAAC;IACrB,KAAY,IAAI,GAAG,MAAM,CAAA;IACzB;;;;;;;OAOG;IACH,KAAY,QAAQ,GAAG;QAAE,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IAE3C;;;;;;;;;;OAUG;IACH,KAAY,OAAO,GAAG;QAAE,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;KAAE,CAAA;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$any.js","sourceRoot":"","sources":["../../../src/$type/special/$any.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { $Branch } from '../branch/$branch.js';
|
|
2
|
+
/**
|
|
3
|
+
* Branch selector for type `never`.
|
|
4
|
+
*/
|
|
5
|
+
export type $Never = $Branch<'$never'>;
|
|
6
|
+
declare const $never: '$never';
|
|
7
|
+
export declare namespace $Never {
|
|
8
|
+
type $Key = '$never';
|
|
9
|
+
/**
|
|
10
|
+
* Options to specifically handles the `never` type.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* type YourType<T, $Options extends $Never.$Options> = ...
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
type $Options = {
|
|
18
|
+
[$never]?: unknown;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Branch option to specifically handles the `never` type.
|
|
22
|
+
*
|
|
23
|
+
* Use this to finely customize the behavior of your type.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* type YourType<T, $Options $Never.$Options> = ...
|
|
28
|
+
*
|
|
29
|
+
* type R = YourType<T, $Never.$Branch> extends $Never ? HandleNever : HandleOthers
|
|
30
|
+
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
type $Branch = {
|
|
34
|
+
[$never]: $Never;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Default option for the `$never` branch.
|
|
38
|
+
*
|
|
39
|
+
* Unsurprisingly, defaulting `$never` to `never`.
|
|
40
|
+
*/
|
|
41
|
+
type $Default = {
|
|
42
|
+
[$never]: never;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Branch selector for type is not `never`.
|
|
47
|
+
*
|
|
48
|
+
* It is used in [`IsNever`](../../never/is_never.ts).
|
|
49
|
+
*/
|
|
50
|
+
export type $NotNever = $Branch<'$not_never'>;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=$never.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$never.d.ts","sourceRoot":"","sources":["../../../src/$type/special/$never.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEtC,OAAO,CAAC,MAAM,MAAM,EAAE,QAAQ,CAAA;AAE9B,yBAAiB,MAAM,CAAC;IACvB,KAAY,IAAI,GAAG,QAAQ,CAAA;IAE3B;;;;;;;OAOG;IACH,KAAY,QAAQ,GAAG;QAAE,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IAE7C;;;;;;;;;;;;OAYG;IACH,KAAY,OAAO,GAAG;QAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAE1C;;;;OAIG;IACH,KAAY,QAAQ,GAAG;QAAE,CAAC,MAAM,CAAC,EAAE,KAAK,CAAA;KAAE,CAAA;CAC1C;AAED;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$never.js","sourceRoot":"","sources":["../../../src/$type/special/$never.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { $BranchOptions } from '../branch/$branch.js';
|
|
2
|
+
import type { $InputOptions } from '../branch/$input_options.js';
|
|
3
|
+
import type { $ResolveBranch } from '../branch/$resolve_branch.js';
|
|
4
|
+
import type { $Else, $Selection, $Then } from '../branch/$selection.js';
|
|
5
|
+
import type { $Any } from './$any.js';
|
|
6
|
+
import type { $Never } from './$never.js';
|
|
7
|
+
import type { $Unknown } from './$unknown.js';
|
|
8
|
+
import type { $Void } from './$void.js';
|
|
9
|
+
/**
|
|
10
|
+
* A type to handle special types: `any`, `unknown`, `never`, and `void`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* type YourType<T, $Options extends $Special.Options> = Special<T,
|
|
15
|
+
* {
|
|
16
|
+
* $any: $ResolveBranch<$Options, [$Any, ...], T>
|
|
17
|
+
* $unknown: $ResolveBranch<$Options, [$Unknown, ...], T>
|
|
18
|
+
* $never: $ResolveBranch<$Options, [$Never, ...], T>
|
|
19
|
+
* $void: $ResolveBranch<$Options, [$Void, ...], T>
|
|
20
|
+
* $then: $ResolveBranch<$Options, [...], T>
|
|
21
|
+
* $else: $ResolveBranch<$Options, [...], T>
|
|
22
|
+
* }>
|
|
23
|
+
*
|
|
24
|
+
* @since 🏷️ 8.0.0
|
|
25
|
+
*/
|
|
26
|
+
export type $Special<T, $O extends $Special.Options = {}> = 0 extends 1 & T ? $ResolveBranch<$O, [$Any, $Then], T> : [T, unknown] extends [unknown, T] ? $ResolveBranch<$O, [$Unknown, $Then], T> : [T, never] extends [never, T] ? $ResolveBranch<$O, [$Never, $Then], T> : [T, void] extends [void, T] ? $ResolveBranch<$O, [$Void, $Then], T> : $ResolveBranch<$O, [$Else]>;
|
|
27
|
+
export declare namespace $Special {
|
|
28
|
+
type Options = $Selection.Options & $InputOptions<$Any | $Unknown | $Never | $Void>;
|
|
29
|
+
type Branch = $Selection.Branch & $BranchOptions<$Any | $Unknown | $Never | $Void>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=$special.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$special.d.ts","sourceRoot":"","sources":["../../../src/$type/special/$special.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AACvE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAEvC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,EAAE,SAAS,QAAQ,CAAC,OAAO,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GACxE,cAAc,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,GACpC,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,GAChC,cAAc,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,GACxC,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,GAC5B,cAAc,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,GACtC,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,GAC1B,cAAc,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,GACrC,cAAc,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;AAEjC,yBAAiB,QAAQ,CAAC;IACzB,KAAY,OAAO,GAAG,UAAU,CAAC,OAAO,GAAG,aAAa,CAAC,IAAI,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC,CAAA;IAC1F,KAAY,MAAM,GAAG,UAAU,CAAC,MAAM,GAAG,cAAc,CAAC,IAAI,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC,CAAA;CACzF"}
|