type-plus 8.0.0-beta.6 → 8.0.0-beta.8
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.reverse.d.ts +1 -1
- package/cjs/array/array.reverse.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/array/literal_array.js +1 -2
- package/cjs/array/literal_array.js.map +1 -1
- package/cjs/array/reduce_while.js +1 -2
- package/cjs/array/reduce_while.js.map +1 -1
- package/cjs/assertion/assert_type.d.ts +1 -1
- package/cjs/assertion/assert_type.d.ts.map +1 -1
- package/cjs/assertion/assert_type.js +1 -4
- package/cjs/assertion/assert_type.js.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/class/isConstructor.js +2 -3
- package/cjs/class/isConstructor.js.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/extract_function.d.ts.map +1 -1
- package/cjs/function/extract_function.js +1 -2
- package/cjs/function/extract_function.js.map +1 -1
- 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/Maybe.js +2 -3
- package/cjs/functional/Maybe.js.map +1 -1
- package/cjs/functional/compose.d.ts.map +1 -1
- package/cjs/functional/compose.js +2 -5
- package/cjs/functional/compose.js.map +1 -1
- package/cjs/functional/context.js +1 -2
- package/cjs/functional/context.js.map +1 -1
- package/cjs/index.d.ts +21 -22
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/json.js +1 -1
- package/cjs/json.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/math/numeric_struct.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 +1 -2
- 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/nodejs/isNodeError.js +1 -2
- package/cjs/nodejs/isNodeError.js.map +1 -1
- package/cjs/nominal/brand.js +1 -2
- package/cjs/nominal/brand.js.map +1 -1
- package/cjs/nominal/flavor.js +1 -2
- package/cjs/nominal/flavor.js.map +1 -1
- package/cjs/nominal/nominal_match.js +1 -2
- package/cjs/nominal/nominal_match.js.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 +1 -1
- package/cjs/object/ANotB.d.ts.map +1 -1
- package/cjs/object/adjust_exact_optional_props.d.ts +6 -3
- package/cjs/object/adjust_exact_optional_props.d.ts.map +1 -1
- package/cjs/object/everyKey.js +1 -2
- package/cjs/object/everyKey.js.map +1 -1
- package/cjs/object/facade.js +1 -2
- package/cjs/object/facade.js.map +1 -1
- package/cjs/object/filterKey.js +1 -2
- package/cjs/object/filterKey.js.map +1 -1
- package/cjs/object/findKey.js +1 -2
- package/cjs/object/findKey.js.map +1 -1
- package/cjs/object/forEachKey.js +1 -2
- package/cjs/object/forEachKey.js.map +1 -1
- package/cjs/object/getField.js +1 -2
- package/cjs/object/getField.js.map +1 -1
- package/cjs/object/hasKey.js +1 -2
- package/cjs/object/hasKey.js.map +1 -1
- package/cjs/object/hasProperty.js +1 -2
- package/cjs/object/hasProperty.js.map +1 -1
- package/cjs/object/index.d.ts +6 -6
- package/cjs/object/index.d.ts.map +1 -1
- package/cjs/object/index.js.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 +1 -1
- package/cjs/object/left_join.d.ts.map +1 -1
- package/cjs/object/mapKey.js +1 -2
- package/cjs/object/mapKey.js.map +1 -1
- package/cjs/object/mapProperties.js +1 -2
- package/cjs/object/mapProperties.js.map +1 -1
- package/cjs/object/merge.d.ts +54 -48
- package/cjs/object/merge.d.ts.map +1 -1
- package/cjs/object/omit.js +1 -2
- package/cjs/object/omit.js.map +1 -1
- package/cjs/object/pick.js +1 -2
- package/cjs/object/pick.js.map +1 -1
- package/cjs/object/properties.d.ts +29 -4
- package/cjs/object/properties.d.ts.map +1 -1
- package/cjs/object/properties.js +1 -0
- package/cjs/object/properties.js.map +1 -1
- package/cjs/object/record.js +1 -2
- package/cjs/object/record.js.map +1 -1
- package/cjs/object/reduceKey.js +2 -2
- package/cjs/object/reduceKey.js.map +1 -1
- package/cjs/object/replaceProperty.js +1 -2
- package/cjs/object/replaceProperty.js.map +1 -1
- package/cjs/object/someKey.js +1 -2
- package/cjs/object/someKey.js.map +1 -1
- package/cjs/object/split.js +1 -2
- package/cjs/object/split.js.map +1 -1
- package/cjs/object/typeOverrideIncompatible.d.ts.map +1 -1
- package/cjs/object/typeOverrideIncompatible.js +1 -2
- package/cjs/object/typeOverrideIncompatible.js.map +1 -1
- package/cjs/predicates/CanAssign.js +1 -2
- package/cjs/predicates/CanAssign.js.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/index.js.map +1 -1
- package/cjs/predicates/not_assignable.d.ts +24 -26
- package/cjs/predicates/not_assignable.d.ts.map +1 -1
- package/cjs/promise/MaybePromise.js +2 -2
- package/cjs/promise/MaybePromise.js.map +1 -1
- package/cjs/promise/index.d.ts +1 -1
- package/cjs/promise/index.d.ts.map +1 -1
- package/cjs/promise/index.js +1 -1
- package/cjs/promise/index.js.map +1 -1
- package/cjs/promise/isPromise.js +2 -3
- package/cjs/promise/isPromise.js.map +1 -1
- package/cjs/promise/mapSeries.js +1 -2
- package/cjs/promise/mapSeries.js.map +1 -1
- package/cjs/string/$extract_manipulated_string.d.ts.map +1 -1
- package/cjs/string/_string_type.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 +2 -3
- package/cjs/testing/stub.d.ts.map +1 -1
- package/cjs/testing/stub.js +1 -2
- 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/drop.js +1 -2
- package/cjs/tuple/drop.js.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 +3 -3
- package/cjs/type-guard/is_type.d.ts.map +1 -1
- package/cjs/type-guard/is_type.js +1 -2
- package/cjs/type-guard/is_type.js.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/union/union_to_intersection.js +1 -2
- package/cjs/union/union_to_intersection.js.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/as.d.ts +1 -1
- package/cjs/utils/as.d.ts.map +1 -1
- package/cjs/utils/as.js +3 -4
- package/cjs/utils/as.js.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/utils/inspect.js +1 -2
- package/cjs/utils/inspect.js.map +1 -1
- 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.reverse.d.ts +1 -1
- package/esm/array/array.reverse.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 +1 -1
- package/esm/assertion/assert_type.d.ts.map +1 -1
- package/esm/assertion/assert_type.js +0 -2
- 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/extract_function.d.ts.map +1 -1
- 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 +21 -22
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/json.js +1 -1
- package/esm/json.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/math/numeric_struct.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 +1 -1
- package/esm/object/ANotB.d.ts.map +1 -1
- package/esm/object/adjust_exact_optional_props.d.ts +6 -3
- package/esm/object/adjust_exact_optional_props.d.ts.map +1 -1
- package/esm/object/index.d.ts +6 -6
- package/esm/object/index.d.ts.map +1 -1
- package/esm/object/index.js.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 +1 -1
- package/esm/object/left_join.d.ts.map +1 -1
- package/esm/object/merge.d.ts +54 -48
- package/esm/object/merge.d.ts.map +1 -1
- package/esm/object/properties.d.ts +29 -4
- package/esm/object/properties.d.ts.map +1 -1
- package/esm/object/properties.js +1 -0
- package/esm/object/properties.js.map +1 -1
- package/esm/object/typeOverrideIncompatible.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/index.js.map +1 -1
- package/esm/predicates/not_assignable.d.ts +24 -26
- package/esm/predicates/not_assignable.d.ts.map +1 -1
- package/esm/promise/index.d.ts +1 -1
- package/esm/promise/index.d.ts.map +1 -1
- package/esm/promise/index.js +1 -1
- package/esm/promise/index.js.map +1 -1
- package/esm/promise/isPromise.js +1 -1
- package/esm/promise/isPromise.js.map +1 -1
- package/esm/string/$extract_manipulated_string.d.ts.map +1 -1
- package/esm/string/_string_type.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 +2 -3
- 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 +3 -3
- 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/as.d.ts +1 -1
- package/esm/utils/as.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 +18 -22
- 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.reverse.ts +2 -5
- 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 -3
- 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 +21 -22
- package/src/json.ts +1 -1
- package/src/logical/logical.ts +52 -0
- package/src/logical/readme.md +53 -0
- package/src/math/abs.ts +1 -1
- package/src/math/numeric_struct.ts +6 -6
- 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 +1 -1
- package/src/object/adjust_exact_optional_props.ts +10 -1
- package/src/object/index.ts +6 -6
- package/src/object/is_not_object.ts +29 -22
- package/src/object/is_object.ts +29 -22
- package/src/object/left_join.ts +1 -1
- package/src/object/merge.ts +53 -49
- package/src/object/properties.ts +35 -2
- package/src/predicates/assignable.ts +23 -25
- package/src/predicates/index.ts +1 -1
- package/src/predicates/not_assignable.ts +24 -26
- package/src/promise/index.ts +1 -1
- package/src/promise/isPromise.ts +1 -1
- package/src/string/$extract_manipulated_string.ts +32 -28
- package/src/string/_string_type.ts +9 -8
- 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/src/equal/equal.ts
CHANGED
|
@@ -1,130 +1,348 @@
|
|
|
1
|
+
import type { $InputOptions } from '../$type/branch/$input_options.js'
|
|
2
|
+
import type { $ResolveBranch } from '../$type/branch/$resolve_branch.js'
|
|
3
|
+
import type { $Else, $Selection, $Then } from '../$type/branch/$selection.js'
|
|
4
|
+
import type { $Distributive } from '../$type/distributive/$distributive.js'
|
|
5
|
+
import type { $Any } from '../$type/special/$any.js'
|
|
6
|
+
import type { $Never } from '../$type/special/$never.js'
|
|
7
|
+
import type { $Special } from '../$type/special/$special.js'
|
|
8
|
+
import type { $Unknown } from '../$type/special/$unknown.js'
|
|
9
|
+
import type { $Void } from '../$type/special/$void.js'
|
|
1
10
|
import type { IsAny } from '../any/is_any.js'
|
|
11
|
+
import type { And, Or } from '../logical/logical.js'
|
|
2
12
|
import type { IsNever } from '../never/is_never.js'
|
|
3
13
|
import type { IsObject } from '../object/is_object.js'
|
|
4
14
|
import type { Properties } from '../object/properties.js'
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type { IdentityEqual } from './identity_equal.js'
|
|
8
|
-
|
|
9
|
-
type BothNever<A, B, Both, One, None> = And<IsNever<A>, IsNever<B>, Both, Or<IsNever<A>, IsNever<B>, One, None>>
|
|
10
|
-
|
|
11
|
-
type BothAny<A, B, Both, One, None> = And<IsAny<A>, IsAny<B>, Both, Or<IsAny<A>, IsAny<B>, One, None>>
|
|
15
|
+
import type { Assignable } from '../predicates/assignable.js'
|
|
16
|
+
import type { IsEqual } from './is_equal.js'
|
|
12
17
|
|
|
13
18
|
/**
|
|
14
|
-
*
|
|
19
|
+
* 🎭 *predicate*
|
|
15
20
|
*
|
|
16
|
-
*
|
|
17
|
-
* type R = IsEqual<1, 1> // true
|
|
18
|
-
* type R = IsEqual<any, any> // true
|
|
19
|
-
* type R = IsEqual<boolean, boolean> // true
|
|
20
|
-
* type R = IsEqual<true, true> // true
|
|
21
|
-
* type R = IsEqual<[1], [1]> // true
|
|
22
|
-
*
|
|
23
|
-
* type R = IsEqual<boolean, true> // false
|
|
24
|
-
* type R = IsEqual<any, 1> // false
|
|
25
|
-
* type R = IsEqual<[any], [1]> // false
|
|
26
|
-
* type R = IsEqual<{ a: 1 }, { a: 1; b: 2 }> // false
|
|
27
|
-
* ```
|
|
21
|
+
* Validate `A` and `B` are "equal".
|
|
28
22
|
*
|
|
29
23
|
* Note that intersection type checks only works at first level.
|
|
30
24
|
* It cannot be check recursively,
|
|
31
25
|
* or else will run into infinite recursion if the type includes recursive types.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* type R = Equal<undefined, undefined> // true
|
|
30
|
+
*
|
|
31
|
+
* type R = Equal<never, undefined> // false
|
|
32
|
+
* type R = Equal<unknown, undefined> // false
|
|
33
|
+
* type R = Equal<string | boolean, undefined> // false
|
|
34
|
+
*
|
|
35
|
+
* type R = Equal<string | undefined, undefined> // boolean
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* 🔱 **branching**
|
|
39
|
+
*
|
|
40
|
+
* Use unique branch identifiers to allow precise processing of the result.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* type R = Equal<undefined, undefined, Equal.$Branch> // $Then
|
|
45
|
+
* type R = Equal<string, undefined, Equal.$Branch> // $Else
|
|
46
|
+
* ```
|
|
32
47
|
*/
|
|
33
|
-
export type
|
|
48
|
+
export type Equal<A, B, $O extends Equal.$Options = {}> = [A, B] extends [B, A]
|
|
34
49
|
? BothNever<
|
|
35
50
|
A,
|
|
36
51
|
B,
|
|
37
|
-
Then
|
|
38
|
-
Else
|
|
52
|
+
$ResolveBranch<$O, [$Then]>,
|
|
53
|
+
$ResolveBranch<$O, [$Else]>,
|
|
39
54
|
BothAny<
|
|
40
55
|
A,
|
|
41
56
|
B,
|
|
42
|
-
Then
|
|
43
|
-
Else
|
|
44
|
-
|
|
57
|
+
$ResolveBranch<$O, [$Then]>,
|
|
58
|
+
$ResolveBranch<$O, [$Else]>,
|
|
59
|
+
Equal.$Same<
|
|
45
60
|
A,
|
|
46
61
|
B,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
IsObject<A>,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
{
|
|
63
|
+
$then: $ResolveBranch<$O, [$Then]>
|
|
64
|
+
$else: [IsObject<A>, IsObject<B>] extends [true, true]
|
|
65
|
+
? Equal.$Same<
|
|
66
|
+
Properties<A>,
|
|
67
|
+
Properties<B>,
|
|
68
|
+
{
|
|
69
|
+
$then: [A, B] extends [(...args: infer P1) => any, (...args: infer P2) => any]
|
|
70
|
+
? IsEqual<P1, P2, $ResolveBranch<$O, [$Then]>, $ResolveBranch<$O, [$Else]>>
|
|
71
|
+
: $ResolveBranch<$O, [$Then]>
|
|
72
|
+
$else: $ResolveBranch<$O, [$Else]>
|
|
73
|
+
}
|
|
74
|
+
>
|
|
75
|
+
: // `A` and `B` are narrowed, need to check again.
|
|
76
|
+
// This is fixed in TS 5.0.2, but keeping it to support older versions.
|
|
77
|
+
[A, B] extends [B, A]
|
|
78
|
+
? $ResolveBranch<$O, [$Then]>
|
|
79
|
+
: $ResolveBranch<$O, [$Else]>
|
|
80
|
+
}
|
|
63
81
|
>
|
|
64
82
|
>
|
|
65
83
|
>
|
|
66
|
-
:
|
|
84
|
+
: $ResolveBranch<$O, [$Else], A>
|
|
85
|
+
|
|
86
|
+
type BothNever<A, B, Both, One, None> = And<
|
|
87
|
+
IsNever<A>,
|
|
88
|
+
IsNever<B>,
|
|
89
|
+
{
|
|
90
|
+
$then: Both
|
|
91
|
+
$else: Or<
|
|
92
|
+
IsNever<A>,
|
|
93
|
+
IsNever<B>,
|
|
94
|
+
{
|
|
95
|
+
$then: One
|
|
96
|
+
$else: None
|
|
97
|
+
}
|
|
98
|
+
>
|
|
99
|
+
}
|
|
100
|
+
>
|
|
101
|
+
|
|
102
|
+
type BothAny<A, B, Both, One, None> = And<
|
|
103
|
+
IsAny<A>,
|
|
104
|
+
IsAny<B>,
|
|
105
|
+
{
|
|
106
|
+
$then: Both
|
|
107
|
+
$else: Or<
|
|
108
|
+
IsAny<A>,
|
|
109
|
+
IsAny<B>,
|
|
110
|
+
{
|
|
111
|
+
$then: One
|
|
112
|
+
$else: None
|
|
113
|
+
}
|
|
114
|
+
>
|
|
115
|
+
}
|
|
116
|
+
>
|
|
117
|
+
// export type Equal<A, B, $O extends Equal.$Options = {}> = [
|
|
118
|
+
// $Special<A, $Special.Branch>,
|
|
119
|
+
// $Special<B, $Special.Branch>,
|
|
120
|
+
// ] extends [infer $A, infer $B]
|
|
121
|
+
// ? [$A, $B] extends [$B, $A]
|
|
122
|
+
// ? $A extends $Else
|
|
123
|
+
// ? // Both `$A` and `$B` are non-special types.
|
|
124
|
+
// [IsObject.$<A, IsObject.$Branch>, IsObject.$<B, IsObject.$Branch>] extends [$Then, $Then]
|
|
125
|
+
// ? Equal.$Same<
|
|
126
|
+
// Properties<A>,
|
|
127
|
+
// Properties<B>,
|
|
128
|
+
// {
|
|
129
|
+
// $then: [A, B] extends [(...args: infer P1) => any, (...args: infer P2) => any]
|
|
130
|
+
// ? Equal<P1, P2, $O>
|
|
131
|
+
// : $ResolveBranch<A, $O, [$Then]>,
|
|
132
|
+
// $else: $ResolveBranch<A, $O, [$Else]>
|
|
133
|
+
// }>: [A, B] extends [B, A] ?
|
|
134
|
+
// $ResolveBranch<A, $O, [$Then]>:
|
|
135
|
+
// $ResolveBranch<A, $O, [$Else]>
|
|
136
|
+
// // Equal.$Same<
|
|
137
|
+
// // Equal.$ToProps<A>,
|
|
138
|
+
// // Equal.$ToProps<B>,
|
|
139
|
+
// // {
|
|
140
|
+
// // $then: $ResolveBranch<A, $O, [$Then]>
|
|
141
|
+
// // $else: $ResolveBranch<A, $O, [$Else]>
|
|
142
|
+
// // }
|
|
143
|
+
// // >
|
|
144
|
+
// : $ResolveBranch<A, $O, [$Then]>
|
|
145
|
+
// : $ResolveBranch<A, $O, [$Else]>
|
|
146
|
+
// : $InferError<'Unable to infer type of $A or $B'>
|
|
147
|
+
|
|
148
|
+
export namespace Equal {
|
|
149
|
+
export type $Options = $Selection.$BaseOptions
|
|
150
|
+
export type $Default = $Selection.Predicate
|
|
151
|
+
export type $Branch = $Selection.Branch
|
|
152
|
+
|
|
153
|
+
export type _ExactEqualDistributive<T, U, $O extends $Options> = T extends U
|
|
154
|
+
? U extends T
|
|
155
|
+
? $ResolveBranch<$O, [$Then], T>
|
|
156
|
+
: $ResolveBranch<$O, [$Else]>
|
|
157
|
+
: $ResolveBranch<$O, [$Else]>
|
|
158
|
+
export type _ExactEqualNonDistributive<T, U, $O extends $Options> = [T, U] extends [U, T]
|
|
159
|
+
? $ResolveBranch<$O, [$Then], T>
|
|
160
|
+
: $ResolveBranch<$O, [$Else]>
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* 🎭 *predicate*
|
|
164
|
+
*
|
|
165
|
+
* Validate `A` and `B` are identically equal.
|
|
166
|
+
*/
|
|
167
|
+
export type $Same<A, B, $O extends $Options> = (<_>() => _ extends (A & _) | _ ? 1 : 2) extends <_>() => _ extends
|
|
168
|
+
| (B & _)
|
|
169
|
+
| _
|
|
170
|
+
? 1
|
|
171
|
+
: 2
|
|
172
|
+
? $O['$then']
|
|
173
|
+
: $O['$else']
|
|
174
|
+
|
|
175
|
+
export type $ToProps<T> = Assignable.$<
|
|
176
|
+
object,
|
|
177
|
+
T,
|
|
178
|
+
{
|
|
179
|
+
$then: T & Properties<T>
|
|
180
|
+
$else: T & Properties<T>
|
|
181
|
+
}
|
|
182
|
+
>
|
|
183
|
+
|
|
184
|
+
// export type $ToProps<T> = T extends (...args: infer A) => infer R
|
|
185
|
+
// ? T extends ((...args: A) => R) & infer U
|
|
186
|
+
// ? [unknown] extends [U]
|
|
187
|
+
// ? T
|
|
188
|
+
// : Properties<U>
|
|
189
|
+
// : 1
|
|
190
|
+
// : T extends Function & infer U
|
|
191
|
+
// ? [unknown] extends [U]
|
|
192
|
+
// ? T
|
|
193
|
+
// : Properties<U>
|
|
194
|
+
// : T extends any[]
|
|
195
|
+
// ? [T] extends [T[0][] & infer U]
|
|
196
|
+
// ? [unknown] extends [U]
|
|
197
|
+
// ? T
|
|
198
|
+
// : T[0][] & Properties<U>
|
|
199
|
+
// : $InferError<'Cannot infer extra properties from Array'>
|
|
200
|
+
// : Properties<T>
|
|
201
|
+
}
|
|
67
202
|
|
|
68
203
|
/**
|
|
69
|
-
*
|
|
204
|
+
* 🎭 *predicate*
|
|
205
|
+
* ㊙️ *internal*
|
|
70
206
|
*
|
|
207
|
+
* Validate if `T` is `U`.
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
71
210
|
* ```ts
|
|
72
|
-
* type R =
|
|
73
|
-
*
|
|
74
|
-
* type R =
|
|
75
|
-
* type R =
|
|
76
|
-
* type R =
|
|
77
|
-
*
|
|
78
|
-
* type R =
|
|
79
|
-
* type R = IsNotEqual<any, 1> // true
|
|
80
|
-
* type R = IsNotEqual<[any], [1]> // true
|
|
81
|
-
* type R = IsNotEqual<{ a: 1 }, { a: 1; b: 2 }> // true
|
|
211
|
+
* type R = $SelectInvert<undefined, undefined> // true
|
|
212
|
+
*
|
|
213
|
+
* type R = $SelectInvert<never, undefined> // false
|
|
214
|
+
* type R = $SelectInvert<unknown, undefined> // false
|
|
215
|
+
* type R = $SelectInvert<string | boolean, undefined> // false
|
|
216
|
+
*
|
|
217
|
+
* type R = $SelectInvert<string | undefined, undefined> // boolean
|
|
82
218
|
* ```
|
|
83
219
|
*
|
|
84
|
-
*
|
|
85
|
-
* It cannot be check recursively,
|
|
86
|
-
* or else will run into infinite recursion if the type includes recursive types.
|
|
87
|
-
*/
|
|
88
|
-
export type IsNotEqual<A, B, Then = true, Else = false> = IsEqual<A, B, Else, Then>
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Checks `A` and `B` are equal.
|
|
220
|
+
* 🔢 *customize*
|
|
92
221
|
*
|
|
93
|
-
*
|
|
94
|
-
* Please use `IsEqual` for the `predicate` behavior.
|
|
222
|
+
* Filter to ensure `T` is `U`, otherwise returns `never`.
|
|
95
223
|
*
|
|
224
|
+
* @example
|
|
96
225
|
* ```ts
|
|
97
|
-
* type R =
|
|
98
|
-
*
|
|
99
|
-
* type R =
|
|
100
|
-
* type R =
|
|
101
|
-
* type R =
|
|
102
|
-
*
|
|
103
|
-
* type R =
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
226
|
+
* type R = $SelectInvert<undefined, undefined, { selection: 'filter' }> // undefined
|
|
227
|
+
*
|
|
228
|
+
* type R = $SelectInvert<never, undefined, { selection: 'filter' }> // never
|
|
229
|
+
* type R = $SelectInvert<unknown, undefined, { selection: 'filter' }> // never
|
|
230
|
+
* type R = $SelectInvert<string | boolean, undefined, { selection: 'filter' }> // never
|
|
231
|
+
*
|
|
232
|
+
* type R = $SelectInvert<string | undefined, undefined> // undefined
|
|
233
|
+
* ```
|
|
234
|
+
*
|
|
235
|
+
* 🔢 *customize*:
|
|
236
|
+
*
|
|
237
|
+
* Disable distribution of union types.
|
|
238
|
+
*
|
|
239
|
+
* ```ts
|
|
240
|
+
* type R = $SelectInvert<undefined | 1, undefined> // boolean
|
|
241
|
+
* type R = $SelectInvert<undefined | 1, undefined, { distributive: false }> // false
|
|
242
|
+
* ```
|
|
243
|
+
*
|
|
244
|
+
* 🔢 *customize*
|
|
245
|
+
*
|
|
246
|
+
* Use unique branch identifiers to allow precise processing of the result.
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* ```ts
|
|
250
|
+
* type R = $SelectInvert<undefined, undefined, $SelectionBranch> // $Then
|
|
251
|
+
* type R = $SelectInvert<string, undefined, $SelectionBranch> // $Else
|
|
107
252
|
* ```
|
|
108
253
|
*/
|
|
109
|
-
export type
|
|
254
|
+
export type $SelectInvert<T, U, $O extends $SelectInvert.$Options = {}> = $Special<
|
|
255
|
+
T,
|
|
256
|
+
{
|
|
257
|
+
$any: $ResolveBranch<$O, [$Any, $Then], T>
|
|
258
|
+
$never: $ResolveBranch<$O, [$Never, $Then], T>
|
|
259
|
+
$unknown: $ResolveBranch<$O, [$Unknown, $Then], T>
|
|
260
|
+
$void: $ResolveBranch<$O, [$Void, $Then], T>
|
|
261
|
+
$else: $Distributive.Parse<$O> extends true ? $SelectInvert._D<T, U, $O> : $SelectInvert._N<T, U, $O>
|
|
262
|
+
}
|
|
263
|
+
>
|
|
264
|
+
|
|
265
|
+
export namespace $SelectInvert {
|
|
266
|
+
export type $Options = $Selection.Options & $Distributive.Options & $InputOptions<$Any | $Unknown | $Never>
|
|
267
|
+
export type $Default = $Selection.Predicate & $Distributive.Default
|
|
268
|
+
export type $Branch = $Selection.Branch & $Distributive.Default
|
|
269
|
+
export type _D<T, U, $O extends $SelectInvert.$Options> = T extends U
|
|
270
|
+
? $ResolveBranch<$O, [$Else]>
|
|
271
|
+
: $ResolveBranch<$O, [$Then], T>
|
|
272
|
+
export type _N<T, U, $O extends $SelectInvert.$Options> = [T] extends [U]
|
|
273
|
+
? $ResolveBranch<$O, [$Else]>
|
|
274
|
+
: $ResolveBranch<$O, [$Then], T>
|
|
275
|
+
}
|
|
110
276
|
|
|
111
277
|
/**
|
|
112
|
-
*
|
|
278
|
+
* 🎭 *predicate*
|
|
279
|
+
* ㊙️ *internal*
|
|
280
|
+
*
|
|
281
|
+
* Validate if `T` is `U`.
|
|
282
|
+
*
|
|
283
|
+
* @example
|
|
284
|
+
* ```ts
|
|
285
|
+
* type R = $SelectInvertStrict<undefined, undefined> // true
|
|
286
|
+
*
|
|
287
|
+
* type R = $SelectInvertStrict<never, undefined> // false
|
|
288
|
+
* type R = $SelectInvertStrict<unknown, undefined> // false
|
|
289
|
+
* type R = $SelectInvertStrict<string | boolean, undefined> // false
|
|
113
290
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
291
|
+
* type R = $SelectInvertStrict<string | undefined, undefined> // boolean
|
|
292
|
+
* ```
|
|
293
|
+
*
|
|
294
|
+
* 🔢 *customize*
|
|
295
|
+
*
|
|
296
|
+
* Filter to ensure `T` is `U`, otherwise returns `never`.
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
* ```ts
|
|
300
|
+
* type R = $SelectInvertStrict<undefined, undefined, { selection: 'filter' }> // undefined
|
|
301
|
+
*
|
|
302
|
+
* type R = $SelectInvertStrict<never, undefined, { selection: 'filter' }> // never
|
|
303
|
+
* type R = $SelectInvertStrict<unknown, undefined, { selection: 'filter' }> // never
|
|
304
|
+
* type R = $SelectInvertStrict<string | boolean, undefined, { selection: 'filter' }> // never
|
|
305
|
+
*
|
|
306
|
+
* type R = $SelectInvertStrict<string | undefined, undefined> // undefined
|
|
307
|
+
* ```
|
|
116
308
|
*
|
|
309
|
+
* 🔢 *customize*:
|
|
310
|
+
*
|
|
311
|
+
* Disable distribution of union types.
|
|
312
|
+
*
|
|
313
|
+
* ```ts
|
|
314
|
+
* type R = $SelectInvertStrict<undefined | 1, undefined> // boolean
|
|
315
|
+
* type R = $SelectInvertStrict<undefined | 1, undefined, { distributive: false }> // false
|
|
316
|
+
* ```
|
|
317
|
+
*
|
|
318
|
+
* 🔢 *customize*
|
|
319
|
+
*
|
|
320
|
+
* Use unique branch identifiers to allow precise processing of the result.
|
|
321
|
+
*
|
|
322
|
+
* @example
|
|
117
323
|
* ```ts
|
|
118
|
-
* type R =
|
|
119
|
-
* type R =
|
|
120
|
-
* type R = NotEqual<boolean, boolean> // false
|
|
121
|
-
* type R = NotEqual<true, true> // false
|
|
122
|
-
* type R = NotEqual<[1], [1]> // false
|
|
123
|
-
*
|
|
124
|
-
* type R = NotEqual<boolean, true> // true
|
|
125
|
-
* type R = NotEqual<any, 1> // true
|
|
126
|
-
* type R = NotEqual<[any], [1]> // true
|
|
127
|
-
* type R = NotEqual<{ a: 1 }, { a: 1; b: 2 }> // true
|
|
324
|
+
* type R = $SelectInvertStrict<undefined, undefined, $SelectionBranch> // $Then
|
|
325
|
+
* type R = $SelectInvertStrict<string, undefined, $SelectionBranch> // $Else
|
|
128
326
|
* ```
|
|
129
327
|
*/
|
|
130
|
-
export type
|
|
328
|
+
export type $SelectInvertStrict<T, U, $O extends $SelectInvertStrict.$Options = {}> = $Special<
|
|
329
|
+
T,
|
|
330
|
+
{
|
|
331
|
+
$any: $ResolveBranch<$O, [$Any, $Then], T>
|
|
332
|
+
$unknown: $ResolveBranch<$O, [$Unknown, $Then], T>
|
|
333
|
+
$never: $ResolveBranch<$O, [$Never, $Then], T>
|
|
334
|
+
$else: $Distributive.Parse<$O> extends true ? $SelectInvertStrict._D<T, U, $O> : $SelectInvertStrict._N<T, U, $O>
|
|
335
|
+
}
|
|
336
|
+
>
|
|
337
|
+
|
|
338
|
+
export namespace $SelectInvertStrict {
|
|
339
|
+
export type $Options = $Selection.Options & $Distributive.Options & $InputOptions<$Any | $Unknown | $Never>
|
|
340
|
+
export type $Default = $Selection.Predicate & $Distributive.Default
|
|
341
|
+
export type $Branch = $Selection.Branch & $Distributive.Default
|
|
342
|
+
export type _D<T, U, $O extends $SelectInvertStrict.$Options> = T extends U
|
|
343
|
+
? $ResolveBranch<$O, [$Else]>
|
|
344
|
+
: $ResolveBranch<$O, [$Then], T>
|
|
345
|
+
export type _N<T, U, $O extends $SelectInvertStrict.$Options> = [T, U] extends [U, T]
|
|
346
|
+
? $ResolveBranch<$O, [$Else]>
|
|
347
|
+
: $ResolveBranch<$O, [$Then], T>
|
|
348
|
+
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
+
import type { Equal } from './equal.js'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* This is a common equal check.
|
|
3
5
|
* It is good for some basic cases, but not for all.
|
|
4
6
|
*/
|
|
5
|
-
export type IdentityEqual<A, B, Then, Else> =
|
|
6
|
-
| (B & _)
|
|
7
|
-
| _
|
|
8
|
-
? 1
|
|
9
|
-
: 2
|
|
10
|
-
? Then
|
|
11
|
-
: Else
|
|
7
|
+
export type IdentityEqual<A, B, Then, Else> = Equal.$Same<A, B, { $then: Then; $else: Else }>
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type { IsAny } from '../any/is_any.js'
|
|
2
|
+
import type { And, Or } from '../logical/logical.js'
|
|
3
|
+
import type { IsNever } from '../never/is_never.js'
|
|
4
|
+
import type { IsObject } from '../object/is_object.js'
|
|
5
|
+
import type { Properties } from '../object/properties.js'
|
|
6
|
+
import type { IsSymbol } from '../symbol/is_symbol.js'
|
|
7
|
+
import type { IdentityEqual } from './identity_equal.js'
|
|
8
|
+
|
|
9
|
+
type BothNever<A, B, Both, One, None> = And<
|
|
10
|
+
IsNever<A>,
|
|
11
|
+
IsNever<B>,
|
|
12
|
+
{
|
|
13
|
+
$then: Both
|
|
14
|
+
$else: Or<
|
|
15
|
+
IsNever<A>,
|
|
16
|
+
IsNever<B>,
|
|
17
|
+
{
|
|
18
|
+
$then: One
|
|
19
|
+
$else: None
|
|
20
|
+
}
|
|
21
|
+
>
|
|
22
|
+
}
|
|
23
|
+
>
|
|
24
|
+
|
|
25
|
+
type BothAny<A, B, Both, One, None> = And<
|
|
26
|
+
IsAny<A>,
|
|
27
|
+
IsAny<B>,
|
|
28
|
+
{
|
|
29
|
+
$then: Both
|
|
30
|
+
$else: Or<
|
|
31
|
+
IsAny<A>,
|
|
32
|
+
IsAny<B>,
|
|
33
|
+
{
|
|
34
|
+
$then: One
|
|
35
|
+
$else: None
|
|
36
|
+
}
|
|
37
|
+
>
|
|
38
|
+
}
|
|
39
|
+
>
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Checks `A` and `B` are equal.
|
|
43
|
+
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* type R = IsEqual<1, 1> // true
|
|
46
|
+
* type R = IsEqual<any, any> // true
|
|
47
|
+
* type R = IsEqual<boolean, boolean> // true
|
|
48
|
+
* type R = IsEqual<true, true> // true
|
|
49
|
+
* type R = IsEqual<[1], [1]> // true
|
|
50
|
+
*
|
|
51
|
+
* type R = IsEqual<boolean, true> // false
|
|
52
|
+
* type R = IsEqual<any, 1> // false
|
|
53
|
+
* type R = IsEqual<[any], [1]> // false
|
|
54
|
+
* type R = IsEqual<{ a: 1 }, { a: 1; b: 2 }> // false
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* Note that intersection type checks only works at first level.
|
|
58
|
+
* It cannot be check recursively,
|
|
59
|
+
* or else will run into infinite recursion if the type includes recursive types.
|
|
60
|
+
*
|
|
61
|
+
* @deprecated 💀 **deprecated since 8.0.0**: use `Equal` instead.
|
|
62
|
+
*/
|
|
63
|
+
export type IsEqual<A, B, Then = true, Else = false> = [A, B] extends [B, A]
|
|
64
|
+
? BothNever<
|
|
65
|
+
A,
|
|
66
|
+
B,
|
|
67
|
+
Then,
|
|
68
|
+
Else,
|
|
69
|
+
BothAny<
|
|
70
|
+
A,
|
|
71
|
+
B,
|
|
72
|
+
Then,
|
|
73
|
+
Else,
|
|
74
|
+
IdentityEqual<
|
|
75
|
+
A,
|
|
76
|
+
B,
|
|
77
|
+
Then,
|
|
78
|
+
And<
|
|
79
|
+
IsObject<A>,
|
|
80
|
+
IsObject<B>,
|
|
81
|
+
{
|
|
82
|
+
$then: IdentityEqual<
|
|
83
|
+
Properties<A>,
|
|
84
|
+
Properties<B>,
|
|
85
|
+
[A, B] extends [(...args: infer P1) => any, (...args: infer P2) => any]
|
|
86
|
+
? IsEqual<P1, P2, Then, Else>
|
|
87
|
+
: Then,
|
|
88
|
+
Else
|
|
89
|
+
>
|
|
90
|
+
// `A` and `B` are narrowed, need to check again.
|
|
91
|
+
// This is fixed in TS 5.0.2, but keeping it to support older versions.
|
|
92
|
+
$else: [A, B] extends [B, A] ? Then : Else
|
|
93
|
+
}
|
|
94
|
+
>
|
|
95
|
+
>
|
|
96
|
+
>
|
|
97
|
+
>
|
|
98
|
+
: And<
|
|
99
|
+
IsSymbol<A, { distributive: false }>,
|
|
100
|
+
IsSymbol<B, { distributive: false }>,
|
|
101
|
+
{
|
|
102
|
+
$then: Then
|
|
103
|
+
$else: Else
|
|
104
|
+
}
|
|
105
|
+
>
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Checks `A` and `B` are not equal.
|
|
109
|
+
*
|
|
110
|
+
* ```ts
|
|
111
|
+
* type R = IsNotEqual<1, 1> // false
|
|
112
|
+
* type R = IsNotEqual<any, any> // false
|
|
113
|
+
* type R = IsNotEqual<boolean, boolean> // false
|
|
114
|
+
* type R = IsNotEqual<true, true> // false
|
|
115
|
+
* type R = IsNotEqual<[1], [1]> // false
|
|
116
|
+
*
|
|
117
|
+
* type R = IsNotEqual<boolean, true> // true
|
|
118
|
+
* type R = IsNotEqual<any, 1> // true
|
|
119
|
+
* type R = IsNotEqual<[any], [1]> // true
|
|
120
|
+
* type R = IsNotEqual<{ a: 1 }, { a: 1; b: 2 }> // true
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* Note that intersection type checks only works at first level.
|
|
124
|
+
* It cannot be check recursively,
|
|
125
|
+
* or else will run into infinite recursion if the type includes recursive types.
|
|
126
|
+
*
|
|
127
|
+
* @deprecated 💀 **deprecated since 8.0.0**: use `Equal` instead.
|
|
128
|
+
*/
|
|
129
|
+
export type IsNotEqual<A, B, Then = true, Else = false> = IsEqual<A, B, Else, Then>
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Checks `A` and `B` are not equal.
|
|
133
|
+
*
|
|
134
|
+
* @deprecated this will be changed to `filter` variant in the future.
|
|
135
|
+
* Please use `IsNotEqual` for the `predicate` behavior.
|
|
136
|
+
*
|
|
137
|
+
* ```ts
|
|
138
|
+
* type R = NotEqual<1, 1> // false
|
|
139
|
+
* type R = NotEqual<any, any> // false
|
|
140
|
+
* type R = NotEqual<boolean, boolean> // false
|
|
141
|
+
* type R = NotEqual<true, true> // false
|
|
142
|
+
* type R = NotEqual<[1], [1]> // false
|
|
143
|
+
*
|
|
144
|
+
* type R = NotEqual<boolean, true> // true
|
|
145
|
+
* type R = NotEqual<any, 1> // true
|
|
146
|
+
* type R = NotEqual<[any], [1]> // true
|
|
147
|
+
* type R = NotEqual<{ a: 1 }, { a: 1; b: 2 }> // true
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
export type NotEqual<A, B, Then = true, Else = false> = IsNotEqual<A, B, Then, Else>
|
package/src/equal/readme.md
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Equality
|
|
2
|
+
|
|
3
|
+
Equality check in TypeScript is hard.
|
|
4
|
+
|
|
5
|
+
In fact, it is impossible to implement a perfect equality check in TypeScript,
|
|
6
|
+
unless TypeScript itself provides a built-in type for it.
|
|
7
|
+
|
|
8
|
+
## [`Equal`](./equal.ts)
|
|
9
|
+
|
|
10
|
+
🏷️ **since 8.0.0**
|
|
11
|
+
|
|
12
|
+
`Equal<A, B>` checks if `A` and `B` are equal.
|
|
13
|
+
|
|
14
|
+
Note that intersection type checks only works at first level.
|
|
15
|
+
It cannot be checked recursively,
|
|
16
|
+
or else will run into infinite recursion if the type includes recursive types.
|
|
17
|
+
|
|
18
|
+
## [`IsEqual`](./is_equal.ts)
|
|
19
|
+
|
|
20
|
+
💀 **deprecated since 8.0.0**: use [`Equal`] instead.
|
|
2
21
|
|
|
3
22
|
`IsEqual<A, B>` and friends check if `A` and `B` are equal.
|
|
4
23
|
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import type { $
|
|
1
|
+
import type { $InputOptions } from '../$type/branch/$input_options.js'
|
|
2
|
+
import type { $ResolveBranch } from '../$type/branch/$resolve_branch.js'
|
|
3
|
+
import type { $Else, $Selection } from '../$type/branch/$selection.js'
|
|
4
|
+
import type { $Distributive } from '../$type/distributive/$distributive.js'
|
|
5
|
+
import type { $Exact } from '../$type/exact/$exact.js'
|
|
6
|
+
import type { $Any } from '../$type/special/$any.js'
|
|
7
|
+
import type { $Never } from '../$type/special/$never.js'
|
|
8
|
+
import type { $Special } from '../$type/special/$special.js'
|
|
9
|
+
import type { $Unknown } from '../$type/special/$unknown.js'
|
|
10
|
+
import type { $Void } from '../$type/special/$void.js'
|
|
11
|
+
import type { $MergeOptions } from '../$type/utils/$merge_options.js'
|
|
12
|
+
import type { Assignable } from '../predicates/assignable.js'
|
|
2
13
|
|
|
3
14
|
/**
|
|
4
15
|
* 🎭 *predicate*
|
|
@@ -53,10 +64,31 @@ import type { $Select } from '../type_plus/branch/$select.js'
|
|
|
53
64
|
* type R = IsFunction<string, $SelectionBranch> // $Else
|
|
54
65
|
* ```
|
|
55
66
|
*/
|
|
56
|
-
export type IsFunction<T, $O extends IsFunction.$Options = {}> = $
|
|
67
|
+
export type IsFunction<T, $O extends IsFunction.$Options = {}> = $Special<
|
|
68
|
+
T,
|
|
69
|
+
$MergeOptions<
|
|
70
|
+
$O,
|
|
71
|
+
{
|
|
72
|
+
$then: $ResolveBranch<$O, [$Else]>
|
|
73
|
+
$else: IsFunction.$<T, $O>
|
|
74
|
+
}
|
|
75
|
+
>
|
|
76
|
+
>
|
|
57
77
|
|
|
58
78
|
export namespace IsFunction {
|
|
59
|
-
export type $Options = $
|
|
60
|
-
|
|
61
|
-
|
|
79
|
+
export type $Options = $Selection.Options &
|
|
80
|
+
$Distributive.Options &
|
|
81
|
+
$Exact.Options &
|
|
82
|
+
$InputOptions<$Any | $Unknown | $Never | $Void>
|
|
83
|
+
export type $Default = $Selection.Predicate & $Distributive.Default & $Exact.Default
|
|
84
|
+
export type $Branch<$O extends $Options = {}> = $Selection.Branch<$O>
|
|
85
|
+
/**
|
|
86
|
+
* 🧰 *type util*
|
|
87
|
+
*
|
|
88
|
+
* Validate if `T` is `Function`.
|
|
89
|
+
*
|
|
90
|
+
* This is a type util for building custom types.
|
|
91
|
+
* It does not check against special types.
|
|
92
|
+
*/
|
|
93
|
+
export type $<T, $O extends Assignable.$UtilOptions> = Assignable.$<T, Function, $O>
|
|
62
94
|
}
|