type-plus 8.0.0-beta.2 → 8.0.0-beta.3
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/any/is_any.d.ts.map +1 -1
- package/esm/any/is_not_any.d.ts.map +1 -1
- package/esm/array/array.at.d.ts.map +1 -1
- package/esm/array/array.entries.d.ts +1 -1
- package/esm/array/array.entries.d.ts.map +1 -1
- package/esm/array/array.find_last.d.ts +1 -1
- package/esm/array/array.find_last.d.ts.map +1 -1
- package/esm/array/array.reverse.d.ts.map +1 -1
- package/esm/array/array.some.d.ts +2 -2
- package/esm/array/array.some.d.ts.map +1 -1
- package/esm/array/array_plus.common_prop_keys.d.ts.map +1 -1
- package/esm/array/array_plus.drop_match.d.ts +1 -1
- package/esm/array/array_plus.drop_match.d.ts.map +1 -1
- package/esm/array/array_plus.element_match.d.ts +4 -2
- package/esm/array/array_plus.element_match.d.ts.map +1 -1
- package/esm/array/array_plus.filter.d.ts +4 -4
- package/esm/array/array_plus.filter.d.ts.map +1 -1
- package/esm/array/array_plus.find.d.ts +1 -1
- package/esm/array/array_plus.find.d.ts.map +1 -1
- 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_index_out_of_bound.d.ts.map +1 -1
- package/esm/array/array_plus.is_readonly.d.ts.map +1 -1
- package/esm/array/array_plus.pad_start.d.ts.map +1 -1
- package/esm/array/array_plus.split_at.d.ts +4 -4
- package/esm/array/array_plus.split_at.d.ts.map +1 -1
- package/esm/array/find_first.d.ts.map +1 -1
- package/esm/array/head.d.ts.map +1 -1
- package/esm/array/intersect_of_props.d.ts.map +1 -1
- package/esm/array/is_array.d.ts +2 -2
- package/esm/array/is_array.d.ts.map +1 -1
- package/esm/array/is_not_array.d.ts +2 -2
- package/esm/array/is_not_array.d.ts.map +1 -1
- package/esm/array/last.d.ts.map +1 -1
- package/esm/array/loose_array_type.d.ts.map +1 -1
- package/esm/array/pad_start.d.ts.map +1 -1
- package/esm/array/reverse.d.ts.map +1 -1
- package/esm/array/union_of_props.d.ts.map +1 -1
- package/esm/assertion/assert_type.js +6 -5
- package/esm/assertion/assert_type.js.map +1 -1
- package/esm/bigint/cast.d.ts.map +1 -1
- package/esm/bigint/is_bigint.d.ts +2 -4
- package/esm/bigint/is_bigint.d.ts.map +1 -1
- package/esm/bigint/is_bigint_literal.d.ts +2 -4
- package/esm/bigint/is_bigint_literal.d.ts.map +1 -1
- package/esm/bigint/is_not_bigint.d.ts +2 -4
- package/esm/bigint/is_not_bigint.d.ts.map +1 -1
- package/esm/bigint/is_not_bigint_literal.d.ts +2 -4
- package/esm/bigint/is_not_bigint_literal.d.ts.map +1 -1
- package/esm/boolean/is_boolean.d.ts +2 -8
- package/esm/boolean/is_boolean.d.ts.map +1 -1
- package/esm/boolean/is_false.d.ts.map +1 -1
- package/esm/boolean/is_not_boolean.d.ts +2 -8
- package/esm/boolean/is_not_boolean.d.ts.map +1 -1
- package/esm/boolean/is_not_false.d.ts.map +1 -1
- package/esm/boolean/is_not_true.d.ts.map +1 -1
- package/esm/boolean/is_true.d.ts.map +1 -1
- package/esm/class/isConstructor.js +1 -0
- package/esm/class/isConstructor.js.map +1 -1
- package/esm/equal/equal.d.ts.map +1 -1
- package/esm/equal/identity_equal.d.ts +1 -1
- package/esm/equal/identity_equal.d.ts.map +1 -1
- package/esm/function/extract_function.d.ts.map +1 -1
- package/esm/function/extract_function.js.map +1 -1
- package/esm/function/is_not_strict_function.d.ts +1 -1
- package/esm/function/is_not_strict_function.d.ts.map +1 -1
- package/esm/function/is_strict_function.d.ts.map +1 -1
- package/esm/functional/Maybe.d.ts.map +1 -1
- package/esm/functional/Maybe.js.map +1 -1
- package/esm/functional/compose.d.ts.map +1 -1
- package/esm/functional/compose.js.map +1 -1
- package/esm/functional/context.d.ts.map +1 -1
- package/esm/math/abs.d.ts.map +1 -1
- package/esm/math/math_plus.to_negative.d.ts.map +1 -1
- package/esm/math/max.d.ts.map +1 -1
- package/esm/math/numeric_struct.d.ts.map +1 -1
- package/esm/mix_types/box.d.ts.map +1 -1
- package/esm/mix_types/is_any_or_never.d.ts.map +1 -1
- package/esm/mix_types/merge.d.ts +9 -9
- package/esm/mix_types/merge.d.ts.map +1 -1
- package/esm/mix_types/merge.js +9 -9
- package/esm/mix_types/merge.js.map +1 -1
- package/esm/never/is_never.d.ts.map +1 -1
- package/esm/never/is_not_never.d.ts.map +1 -1
- package/esm/nodejs/isNodeError.d.ts.map +1 -1
- package/esm/nominal/brand.d.ts.map +1 -1
- package/esm/nominal/brand.js +1 -1
- package/esm/nominal/brand.js.map +1 -1
- package/esm/nominal/flavor.d.ts.map +1 -1
- package/esm/nominal/flavor.js +1 -1
- package/esm/nominal/flavor.js.map +1 -1
- package/esm/nominal/nominal_match.d.ts.map +1 -1
- package/esm/nominal/nominal_match.js.map +1 -1
- package/esm/null/is_not_null.d.ts.map +1 -1
- package/esm/null/is_null.d.ts.map +1 -1
- package/esm/number/cast.d.ts.map +1 -1
- package/esm/number/is_not_number.d.ts +2 -4
- package/esm/number/is_not_number.d.ts.map +1 -1
- package/esm/number/is_not_number_literal.d.ts +2 -4
- package/esm/number/is_not_number_literal.d.ts.map +1 -1
- package/esm/number/is_number.d.ts +2 -4
- package/esm/number/is_number.d.ts.map +1 -1
- package/esm/number/is_number_literal.d.ts +2 -4
- package/esm/number/is_number_literal.d.ts.map +1 -1
- package/esm/numeric/is_integer.d.ts +2 -2
- package/esm/numeric/is_integer.d.ts.map +1 -1
- package/esm/numeric/is_negative.d.ts +5 -5
- package/esm/numeric/is_negative.d.ts.map +1 -1
- package/esm/numeric/is_not_integer.d.ts +2 -2
- package/esm/numeric/is_not_integer.d.ts.map +1 -1
- package/esm/numeric/is_not_negative.d.ts +3 -3
- package/esm/numeric/is_not_negative.d.ts.map +1 -1
- package/esm/numeric/is_not_positive.d.ts +3 -3
- package/esm/numeric/is_not_positive.d.ts.map +1 -1
- package/esm/numeric/is_positive.d.ts +3 -3
- package/esm/numeric/is_positive.d.ts.map +1 -1
- package/esm/numeric/numeric_type.d.ts.map +1 -1
- package/esm/object/ANotB.d.ts.map +1 -1
- package/esm/object/IsDisjoint.d.ts.map +1 -1
- package/esm/object/KeysWithDiffType.d.ts.map +1 -1
- package/esm/object/KnownKeys.d.ts.map +1 -1
- package/esm/object/RecursiveIntersect.d.ts +1 -1
- package/esm/object/RecursiveIntersect.d.ts.map +1 -1
- package/esm/object/RecursiveRequired.d.ts.map +1 -1
- package/esm/object/SpreadRecord.d.ts.map +1 -1
- package/esm/object/facade.d.ts.map +1 -1
- package/esm/object/facade.js.map +1 -1
- package/esm/object/getField.d.ts.map +1 -1
- package/esm/object/getField.js.map +1 -1
- package/esm/object/hasKey.js +1 -1
- package/esm/object/hasKey.js.map +1 -1
- package/esm/object/is_not_object.d.ts +1 -3
- package/esm/object/is_not_object.d.ts.map +1 -1
- package/esm/object/is_object.d.ts.map +1 -1
- package/esm/object/left_join.d.ts.map +1 -1
- package/esm/object/merge.d.ts +6 -5
- package/esm/object/merge.d.ts.map +1 -1
- package/esm/object/omit.d.ts +7 -0
- package/esm/object/omit.d.ts.map +1 -1
- package/esm/object/omit.js.map +1 -1
- package/esm/object/optional_key.d.ts.map +1 -1
- package/esm/object/pick.d.ts.map +1 -1
- package/esm/object/pick.js.map +1 -1
- package/esm/object/recursive_partial.d.ts.map +1 -1
- package/esm/object/split.d.ts +1 -7
- package/esm/object/split.d.ts.map +1 -1
- package/esm/object/split.js +1 -1
- package/esm/object/split.js.map +1 -1
- package/esm/object/typeOverrideIncompatible.js.map +1 -1
- package/esm/predicates/CanAssign.d.ts.map +1 -1
- package/esm/predicates/CanAssign.js.map +1 -1
- package/esm/predicates/assignable.d.ts.map +1 -1
- package/esm/predicates/literal.d.ts.map +1 -1
- package/esm/predicates/logical.d.ts.map +1 -1
- package/esm/predicates/not_assignable.d.ts.map +1 -1
- package/esm/primitive.d.ts.map +1 -1
- package/esm/promise/index.d.ts.map +1 -1
- package/esm/promise/mapSeries.js +1 -1
- package/esm/promise/mapSeries.js.map +1 -1
- package/esm/string/$extract_manipulated_string.d.ts +5 -5
- 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 +2 -4
- package/esm/string/is_not_string.d.ts.map +1 -1
- package/esm/string/is_not_string_literal.d.ts +4 -8
- package/esm/string/is_not_string_literal.d.ts.map +1 -1
- package/esm/string/is_not_template_literal.d.ts.map +1 -1
- package/esm/string/is_string.d.ts +2 -4
- package/esm/string/is_string.d.ts.map +1 -1
- package/esm/string/is_string_literal.d.ts +4 -8
- package/esm/string/is_string_literal.d.ts.map +1 -1
- package/esm/string/is_template_literal.d.ts.map +1 -1
- package/esm/string/string.d.ts.map +1 -1
- package/esm/string/string_plus.d.ts.map +1 -1
- package/esm/symbol/is_not_symbol.d.ts.map +1 -1
- package/esm/symbol/is_symbol.d.ts.map +1 -1
- package/esm/testing/test_type.d.ts.map +1 -1
- package/esm/tuple/common_prop_keys.d.ts.map +1 -1
- package/esm/tuple/create_tuple.d.ts.map +1 -1
- package/esm/tuple/drop.d.ts.map +1 -1
- package/esm/tuple/drop.js +1 -1
- package/esm/tuple/drop.js.map +1 -1
- package/esm/tuple/is_not_tuple.d.ts +2 -2
- package/esm/tuple/is_not_tuple.d.ts.map +1 -1
- package/esm/tuple/is_tuple.d.ts +2 -2
- package/esm/tuple/is_tuple.d.ts.map +1 -1
- package/esm/tuple/tail.d.ts +1 -1
- package/esm/tuple/tail.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.map +1 -1
- package/esm/tuple/tuple_plus.filter.d.ts +1 -1
- package/esm/tuple/tuple_plus.filter.d.ts.map +1 -1
- package/esm/tuple/tuple_plus.find.d.ts +2 -2
- package/esm/tuple/tuple_plus.find.d.ts.map +1 -1
- package/esm/tuple/tuple_plus.pad_start.d.ts +1 -4
- package/esm/tuple/tuple_plus.pad_start.d.ts.map +1 -1
- package/esm/type_plus/$equality.d.ts.map +1 -1
- package/esm/type_plus/$infer_error.d.ts.map +1 -1
- package/esm/type_plus/$merge_options.d.ts.map +1 -1
- package/esm/type_plus/$resolve_options.d.ts +1 -1
- package/esm/type_plus/$resolve_options.d.ts.map +1 -1
- package/esm/type_plus/$special_type.d.ts +1 -7
- package/esm/type_plus/$special_type.d.ts.map +1 -1
- package/esm/type_plus/$type.d.ts.map +1 -1
- package/esm/type_plus/branch/$branch.d.ts.map +1 -1
- package/esm/type_plus/branch/$exact.d.ts +4 -1
- package/esm/type_plus/branch/$exact.d.ts.map +1 -1
- package/esm/type_plus/branch/$input_options.d.ts.map +1 -1
- package/esm/type_plus/branch/$is_distributive.d.ts.map +1 -1
- package/esm/type_plus/branch/$resolve_branch.d.ts +8 -9
- package/esm/type_plus/branch/$resolve_branch.d.ts.map +1 -1
- package/esm/type_plus/branch/$select.d.ts +1 -3
- package/esm/type_plus/branch/$select.d.ts.map +1 -1
- package/esm/type_plus/branch/$select_invert.d.ts +1 -3
- package/esm/type_plus/branch/$select_invert.d.ts.map +1 -1
- package/esm/type_plus/branch/$select_invert_strict.d.ts +1 -4
- package/esm/type_plus/branch/$select_invert_strict.d.ts.map +1 -1
- package/esm/type_plus/branch/$select_strict.d.ts +1 -4
- package/esm/type_plus/branch/$select_strict.d.ts.map +1 -1
- package/esm/type_plus/branch/$selection.d.ts.map +1 -1
- package/esm/type_plus/branch/$selection_options.d.ts.map +1 -1
- package/esm/undefined/has_undefined.d.ts +3 -1
- package/esm/undefined/has_undefined.d.ts.map +1 -1
- package/esm/undefined/is_not_undefined.d.ts.map +1 -1
- package/esm/undefined/is_undefined.d.ts.map +1 -1
- package/esm/union/union.d.ts.map +1 -1
- package/esm/union/union_to_intersection.d.ts.map +1 -1
- package/esm/union/union_to_intersection.js.map +1 -1
- package/esm/unknown/is_not_unknown.d.ts.map +1 -1
- package/esm/unknown/is_unknown.d.ts.map +1 -1
- package/esm/unknown/not_unknown_or.d.ts.map +1 -1
- package/esm/unknown/unknown.d.ts.map +1 -1
- package/esm/utils/index.d.ts.map +1 -1
- package/esm/void/is_not_void.d.ts.map +1 -1
- package/esm/void/is_void.d.ts.map +1 -1
- package/package.json +3 -4
- package/src/any/is_any.ts +8 -8
- package/src/any/is_not_any.ts +8 -8
- package/src/array/array.at.ts +22 -19
- package/src/array/array.entries.ts +3 -3
- package/src/array/array.find_last.ts +6 -6
- package/src/array/array.reverse.ts +3 -2
- package/src/array/array.some.ts +4 -4
- package/src/array/array_plus.common_prop_keys.ts +5 -6
- package/src/array/array_plus.drop_match.ts +7 -7
- package/src/array/array_plus.element_match.ts +25 -22
- package/src/array/array_plus.filter.ts +11 -12
- package/src/array/array_plus.find.ts +9 -11
- package/src/array/array_plus.index_at.ts +29 -35
- package/src/array/array_plus.is_index_out_of_bound.ts +1 -1
- package/src/array/array_plus.is_readonly.ts +17 -21
- package/src/array/array_plus.pad_start.ts +3 -7
- package/src/array/array_plus.split_at.ts +17 -19
- package/src/array/find_first.ts +6 -5
- package/src/array/head.ts +9 -8
- package/src/array/intersect_of_props.ts +5 -5
- package/src/array/is_array.ts +31 -32
- package/src/array/is_not_array.ts +32 -32
- package/src/array/last.ts +14 -9
- package/src/array/loose_array_type.ts +2 -2
- package/src/array/pad_start.ts +1 -3
- package/src/array/reverse.ts +8 -8
- package/src/array/union_of_props.ts +2 -2
- package/src/assertion/assert_type.ts +5 -3
- package/src/bigint/cast.ts +2 -2
- package/src/bigint/is_bigint.ts +17 -20
- package/src/bigint/is_bigint_literal.ts +12 -14
- package/src/bigint/is_not_bigint.ts +14 -16
- package/src/bigint/is_not_bigint_literal.ts +17 -16
- package/src/boolean/is_boolean.ts +48 -36
- package/src/boolean/is_false.ts +5 -3
- package/src/boolean/is_not_boolean.ts +23 -25
- package/src/boolean/is_not_false.ts +5 -3
- package/src/boolean/is_not_true.ts +5 -3
- package/src/boolean/is_true.ts +5 -3
- package/src/class/isConstructor.ts +1 -1
- package/src/equal/equal.ts +22 -27
- package/src/equal/identity_equal.ts +5 -3
- package/src/function/extract_function.ts +1 -3
- package/src/function/is_not_strict_function.ts +12 -12
- package/src/function/is_strict_function.ts +12 -14
- package/src/functional/Maybe.ts +1 -3
- package/src/functional/compose.ts +2 -4
- package/src/functional/context.ts +1 -1
- package/src/index.ts +0 -1
- package/src/math/abs.ts +18 -8
- package/src/math/math_plus.to_negative.ts +6 -6
- package/src/math/max.ts +2 -2
- package/src/math/numeric_struct.ts +225 -231
- package/src/mix_types/box.ts +34 -37
- package/src/mix_types/is_any_or_never.ts +6 -6
- package/src/mix_types/merge.ts +24 -28
- package/src/never/is_never.ts +13 -10
- package/src/never/is_not_never.ts +13 -10
- package/src/nodejs/isNodeError.ts +13 -13
- package/src/nominal/brand.ts +3 -4
- package/src/nominal/flavor.ts +3 -4
- package/src/nominal/nominal_match.ts +3 -10
- package/src/null/is_not_null.ts +5 -4
- package/src/null/is_null.ts +9 -8
- package/src/number/cast.ts +6 -6
- package/src/number/is_not_number.ts +15 -17
- package/src/number/is_not_number_literal.ts +17 -16
- package/src/number/is_number.ts +15 -17
- package/src/number/is_number_literal.ts +12 -14
- package/src/numeric/is_integer.ts +33 -27
- package/src/numeric/is_negative.ts +23 -23
- package/src/numeric/is_not_integer.ts +31 -26
- package/src/numeric/is_not_negative.ts +19 -19
- package/src/numeric/is_not_positive.ts +19 -19
- package/src/numeric/is_positive.ts +21 -21
- package/src/numeric/numeric_plus.ts +0 -1
- package/src/numeric/numeric_type.ts +0 -1
- package/src/object/ANotB.ts +2 -2
- package/src/object/IsDisjoint.ts +1 -4
- package/src/object/KeysWithDiffType.ts +2 -2
- package/src/object/KnownKeys.ts +7 -7
- package/src/object/RecursiveIntersect.ts +8 -8
- package/src/object/RecursiveRequired.ts +2 -2
- package/src/object/SpreadRecord.ts +1 -4
- package/src/object/facade.ts +1 -9
- package/src/object/getField.ts +1 -4
- package/src/object/hasKey.ts +1 -1
- package/src/object/is_not_object.ts +23 -16
- package/src/object/is_object.ts +23 -15
- package/src/object/left_join.ts +2 -2
- package/src/object/merge.ts +53 -72
- package/src/object/omit.ts +16 -25
- package/src/object/optional_key.ts +1 -4
- package/src/object/pick.ts +8 -19
- package/src/object/recursive_partial.ts +6 -6
- package/src/object/split.ts +3 -14
- package/src/object/typeOverrideIncompatible.ts +3 -3
- package/src/predicates/CanAssign.ts +9 -5
- package/src/predicates/assignable.ts +23 -24
- package/src/predicates/literal.ts +8 -8
- package/src/predicates/logical.ts +4 -4
- package/src/predicates/not_assignable.ts +23 -22
- package/src/primitive.ts +1 -10
- package/src/promise/index.ts +1 -1
- package/src/promise/mapSeries.ts +1 -1
- package/src/string/$extract_manipulated_string.ts +25 -20
- package/src/string/_string_type.ts +6 -6
- package/src/string/is_not_string.ts +13 -15
- package/src/string/is_not_string_literal.ts +29 -34
- package/src/string/is_not_template_literal.ts +18 -21
- package/src/string/is_string.ts +17 -20
- package/src/string/is_string_literal.ts +29 -34
- package/src/string/is_template_literal.ts +18 -20
- package/src/string/string.ts +2 -2
- package/src/string/string_plus.ts +6 -7
- package/src/symbol/is_not_symbol.ts +5 -3
- package/src/symbol/is_symbol.ts +5 -3
- package/src/testing/test_type.ts +89 -89
- package/src/tuple/common_prop_keys.ts +2 -5
- package/src/tuple/create_tuple.ts +18 -18
- package/src/tuple/drop.ts +20 -22
- package/src/tuple/is_not_tuple.ts +19 -21
- package/src/tuple/is_tuple.ts +23 -26
- package/src/tuple/tail.ts +5 -3
- package/src/tuple/tuple_plus.common_prop_keys.ts +6 -12
- package/src/tuple/tuple_plus.drop_match.ts +11 -11
- package/src/tuple/tuple_plus.filter.ts +5 -12
- package/src/tuple/tuple_plus.find.ts +14 -24
- package/src/tuple/tuple_plus.pad_start.ts +12 -27
- package/src/type_plus/$equality.ts +1 -3
- package/src/type_plus/$infer_error.ts +3 -1
- package/src/type_plus/$merge_options.ts +3 -4
- package/src/type_plus/$resolve_options.ts +6 -5
- package/src/type_plus/$special_type.ts +7 -5
- package/src/type_plus/$type.ts +3 -3
- package/src/type_plus/branch/$branch.ts +1 -2
- package/src/type_plus/branch/$exact.ts +9 -5
- package/src/type_plus/branch/$input_options.ts +1 -2
- package/src/type_plus/branch/$is_distributive.ts +7 -4
- package/src/type_plus/branch/$resolve_branch.ts +29 -39
- package/src/type_plus/branch/$select.ts +15 -16
- package/src/type_plus/branch/$select_invert.ts +11 -16
- package/src/type_plus/branch/$select_invert_strict.ts +14 -19
- package/src/type_plus/branch/$select_strict.ts +11 -13
- package/src/type_plus/branch/$selection.ts +8 -9
- package/src/type_plus/branch/$selection_options.ts +3 -3
- package/src/undefined/has_undefined.ts +4 -3
- package/src/undefined/is_not_undefined.ts +9 -9
- package/src/undefined/is_undefined.ts +9 -8
- package/src/union/union.ts +1 -4
- package/src/union/union_to_intersection.ts +1 -3
- package/src/unknown/is_not_unknown.ts +8 -8
- package/src/unknown/is_unknown.ts +8 -8
- package/src/unknown/not_unknown_or.ts +7 -3
- package/src/unknown/unknown.ts +0 -1
- package/src/utils/index.ts +17 -17
- package/src/void/is_not_void.ts +14 -14
- package/src/void/is_void.ts +14 -14
|
@@ -15,33 +15,39 @@ import type { $Else, $Then } from '../type_plus/branch/$selection.js'
|
|
|
15
15
|
* type R = IsInteger<number> // false as it contains non-integer
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
export type IsInteger<T, $O extends IsInteger.$Options = {}> = IsNumber<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
? $ResolveBranch<T, $O, [$Else]>
|
|
29
|
-
:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
18
|
+
export type IsInteger<T, $O extends IsInteger.$Options = {}> = IsNumber<
|
|
19
|
+
T,
|
|
20
|
+
{
|
|
21
|
+
distributive: $O['distributive']
|
|
22
|
+
$then: $Then
|
|
23
|
+
$else: $Else
|
|
24
|
+
}
|
|
25
|
+
> extends infer R
|
|
26
|
+
? R extends $Then
|
|
27
|
+
? number extends T
|
|
28
|
+
? $ResolveBranch<number, $O, [$Then]> | $ResolveBranch<T, $O, [$Else]>
|
|
29
|
+
: T extends number & infer U
|
|
30
|
+
? `${T}` extends `${number}.${number}`
|
|
31
|
+
? $ResolveBranch<T, $O, [$Else]>
|
|
32
|
+
: [T, U] extends [U, T]
|
|
33
|
+
? $ResolveBranch<T, $O, [$Then]>
|
|
34
|
+
: $ResolveBranch<number, $O, [$Then]> | $ResolveBranch<T, $O, [$Else]>
|
|
35
|
+
: never
|
|
36
|
+
: R extends $Else
|
|
37
|
+
? IsBigint<
|
|
38
|
+
T,
|
|
39
|
+
{
|
|
40
|
+
distributive: $O['distributive']
|
|
41
|
+
$then: $Then
|
|
42
|
+
$else: $Else
|
|
43
|
+
}
|
|
44
|
+
> extends infer R
|
|
45
|
+
? R extends $Then
|
|
46
|
+
? $ResolveBranch<T, $O, [$Then]>
|
|
47
|
+
: $ResolveBranch<T, $O, [$Else]>
|
|
48
|
+
: never
|
|
49
|
+
: never
|
|
50
|
+
: never
|
|
45
51
|
export namespace IsInteger {
|
|
46
52
|
export type $Options = $Equality.$Options
|
|
47
53
|
export type $Branch<$O extends $Options = {}> = $Equality.$Branch<$O>
|
|
@@ -10,7 +10,7 @@ import type { $Else, $Then } from '../type_plus/branch/$selection.js'
|
|
|
10
10
|
* ```ts
|
|
11
11
|
* type R = IsNegative<-1> // true
|
|
12
12
|
* type R = IsNegative<-1n> // true
|
|
13
|
-
*
|
|
13
|
+
*
|
|
14
14
|
* type R = IsNegative<0> // false
|
|
15
15
|
* type R = IsNegative<1> // false
|
|
16
16
|
*
|
|
@@ -18,34 +18,34 @@ import type { $Else, $Then } from '../type_plus/branch/$selection.js'
|
|
|
18
18
|
* type R = IsNegative<bigint> // boolean
|
|
19
19
|
* type R = IsNegative<any> // boolean
|
|
20
20
|
* ```
|
|
21
|
-
*/
|
|
22
|
-
export type IsNegative<T, $O extends IsNegative.$Options = {}> = IsBigint<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
21
|
+
*/
|
|
22
|
+
export type IsNegative<T, $O extends IsNegative.$Options = {}> = IsBigint<
|
|
23
|
+
T,
|
|
24
|
+
{
|
|
25
|
+
distributive: $O['distributive']
|
|
26
|
+
$then: $Then
|
|
27
|
+
$else: $Else
|
|
28
|
+
}
|
|
29
|
+
> extends infer R
|
|
30
|
+
? R extends $Then
|
|
31
|
+
? IsNegative._Negative<T, bigint, $O>
|
|
32
|
+
: IsNumber<Exclude<T, bigint>, { distributive: $O['distributive']; $then: $Then; $else: $Else }> extends infer R
|
|
33
|
+
? R extends $Then
|
|
34
|
+
? IsNegative._Negative<T, number, $O>
|
|
35
|
+
: $ResolveBranch<T, $O, [$Else]>
|
|
36
|
+
: never
|
|
37
37
|
: never
|
|
38
38
|
|
|
39
39
|
export namespace IsNegative {
|
|
40
40
|
export type $Options = $Equality.$Options
|
|
41
41
|
export type $Branch<$O extends $Options = {}> = $Equality.$Branch<$O>
|
|
42
42
|
export type _Negative<T, U extends number | bigint, $O extends IsNegative.$Options> = T extends U & infer R
|
|
43
|
-
?
|
|
44
|
-
`${T}` extends `-${string}`
|
|
43
|
+
? `${T}` extends `-${string}`
|
|
45
44
|
? $ResolveBranch<T, $O, [$Then]>
|
|
46
|
-
: U extends T
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
: U extends T
|
|
46
|
+
? $ResolveBranch<T, $O, [$Then]> | $ResolveBranch<T, $O, [$Else]>
|
|
47
|
+
: [T, R] extends [R, T]
|
|
48
|
+
? $ResolveBranch<T, $O, [$Else]>
|
|
49
|
+
: $ResolveBranch<number, $O, [$Then]> | $ResolveBranch<T, $O, [$Else]>
|
|
50
50
|
: never
|
|
51
51
|
}
|
|
@@ -17,32 +17,37 @@ import type { $Else, $Then } from '../type_plus/branch/$selection.js'
|
|
|
17
17
|
* type R = IsNotInteger<1n> // false
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
export type IsNotInteger<T, $O extends IsNotInteger.$Options = {}> = IsNumber<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
? $ResolveBranch<T, $O, [$Then]>
|
|
31
|
-
:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
20
|
+
export type IsNotInteger<T, $O extends IsNotInteger.$Options = {}> = IsNumber<
|
|
21
|
+
T,
|
|
22
|
+
{
|
|
23
|
+
distributive: $O['distributive']
|
|
24
|
+
$then: $Then
|
|
25
|
+
$else: $Else
|
|
26
|
+
}
|
|
27
|
+
> extends infer R
|
|
28
|
+
? R extends $Then
|
|
29
|
+
? number extends T
|
|
30
|
+
? $ResolveBranch<T, $O, [$Then]> | $ResolveBranch<T, $O, [$Else]>
|
|
31
|
+
: T extends number
|
|
32
|
+
? `${T}` extends `${number}.${number}`
|
|
33
|
+
? $ResolveBranch<T, $O, [$Then]>
|
|
34
|
+
: $ResolveBranch<T, $O, [$Else]>
|
|
35
|
+
: never
|
|
36
|
+
: R extends $Else
|
|
37
|
+
? IsBigint<
|
|
38
|
+
T,
|
|
39
|
+
{
|
|
40
|
+
distributive: $O['distributive']
|
|
41
|
+
$then: $Then
|
|
42
|
+
$else: $Else
|
|
43
|
+
}
|
|
44
|
+
> extends infer R
|
|
45
|
+
? R extends $Then
|
|
46
|
+
? $ResolveBranch<T, $O, [$Else]>
|
|
47
|
+
: $ResolveBranch<Exclude<T, number>, $O, [$Then]>
|
|
48
|
+
: never
|
|
49
|
+
: never
|
|
50
|
+
: never
|
|
46
51
|
export namespace IsNotInteger {
|
|
47
52
|
export type $Options = $Equality.$Options
|
|
48
53
|
export type $Branch<$O extends $Options = {}> = $Equality.$Branch<$O>
|
|
@@ -19,31 +19,31 @@ import type { $Else, $Then } from '../type_plus/branch/$selection.js'
|
|
|
19
19
|
* type R = IsNotNegative<any> // boolean
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
export type IsNotNegative<T, $O extends IsNotNegative.$Options = {}> = IsBigint<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
export type IsNotNegative<T, $O extends IsNotNegative.$Options = {}> = IsBigint<
|
|
23
|
+
T,
|
|
24
|
+
{
|
|
25
|
+
distributive: $O['distributive']
|
|
26
|
+
$then: $Then
|
|
27
|
+
$else: $Else
|
|
28
|
+
}
|
|
29
|
+
> extends infer R
|
|
30
|
+
? R extends $Then
|
|
31
|
+
? IsNotNegative._Negative<T, bigint, $O>
|
|
32
|
+
: IsNumber<Exclude<T, bigint>, { distributive: $O['distributive']; $then: $Then; $else: $Else }> extends infer R
|
|
33
|
+
? R extends $Then
|
|
34
|
+
? IsNotNegative._Negative<T, number, $O>
|
|
35
|
+
: $ResolveBranch<Exclude<T, number | bigint>, $O, [$Then]>
|
|
36
|
+
: never
|
|
37
37
|
: never
|
|
38
38
|
|
|
39
39
|
export namespace IsNotNegative {
|
|
40
40
|
export type $Options = $Equality.$Options
|
|
41
41
|
export type $Branch<$O extends $Options = {}> = $Equality.$Branch<$O>
|
|
42
42
|
export type _Negative<T, U extends number | bigint, $O extends IsNotNegative.$Options> = T extends U
|
|
43
|
-
?
|
|
44
|
-
`${T}` extends `-${string}`
|
|
43
|
+
? `${T}` extends `-${string}`
|
|
45
44
|
? $ResolveBranch<T, $O, [$Else]>
|
|
46
|
-
: U extends T
|
|
47
|
-
|
|
45
|
+
: U extends T
|
|
46
|
+
? $ResolveBranch<T, $O, [$Then]> | $ResolveBranch<T, $O, [$Else]>
|
|
47
|
+
: $ResolveBranch<T, $O, [$Then]>
|
|
48
48
|
: never
|
|
49
49
|
}
|
|
@@ -20,31 +20,31 @@ import type { $Else, $Then } from '../type_plus/branch/$selection.js'
|
|
|
20
20
|
*
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
export type IsNotPositive<T, $O extends IsNotPositive.$Options = {}> = IsBigint<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
export type IsNotPositive<T, $O extends IsNotPositive.$Options = {}> = IsBigint<
|
|
24
|
+
T,
|
|
25
|
+
{
|
|
26
|
+
distributive: $O['distributive']
|
|
27
|
+
$then: $Then
|
|
28
|
+
$else: $Else
|
|
29
|
+
}
|
|
30
|
+
> extends infer R
|
|
31
|
+
? R extends $Then
|
|
32
|
+
? IsNotPositive._Negative<T, bigint, $O>
|
|
33
|
+
: IsNumber<Exclude<T, bigint>, { distributive: $O['distributive']; $then: $Then; $else: $Else }> extends infer R
|
|
34
|
+
? R extends $Then
|
|
35
|
+
? IsNotPositive._Negative<T, number, $O>
|
|
36
|
+
: $ResolveBranch<Exclude<T, number | bigint>, $O, [$Then]>
|
|
37
|
+
: never
|
|
38
38
|
: never
|
|
39
39
|
|
|
40
40
|
export namespace IsNotPositive {
|
|
41
41
|
export type $Options = $Equality.$Options
|
|
42
42
|
export type $Branch<$O extends $Options = {}> = $Equality.$Branch<$O>
|
|
43
43
|
export type _Negative<T, U extends number | bigint, $O extends IsNotPositive.$Options> = T extends U
|
|
44
|
-
?
|
|
45
|
-
`${T}` extends `-${string}`
|
|
44
|
+
? `${T}` extends `-${string}`
|
|
46
45
|
? $ResolveBranch<T, $O, [$Then]>
|
|
47
|
-
: U extends T
|
|
48
|
-
|
|
46
|
+
: U extends T
|
|
47
|
+
? $ResolveBranch<T, $O, [$Then]> | $ResolveBranch<T, $O, [$Else]>
|
|
48
|
+
: $ResolveBranch<T, $O, [$Else]>
|
|
49
49
|
: never
|
|
50
50
|
}
|
|
@@ -19,33 +19,33 @@ import type { $Else, $Then } from '../type_plus/branch/$selection.js'
|
|
|
19
19
|
* type R = IsPositive<-1> // false
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
export type IsPositive<T, $O extends IsPositive.$Options = {}> = IsBigint<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
export type IsPositive<T, $O extends IsPositive.$Options = {}> = IsBigint<
|
|
23
|
+
T,
|
|
24
|
+
{
|
|
25
|
+
distributive: $O['distributive']
|
|
26
|
+
$then: $Then
|
|
27
|
+
$else: $Else
|
|
28
|
+
}
|
|
29
|
+
> extends infer R
|
|
30
|
+
? R extends $Then
|
|
31
|
+
? IsPositive._Positive<T, bigint, $O>
|
|
32
|
+
: IsNumber<Exclude<T, bigint>, { distributive: $O['distributive']; $then: $Then; $else: $Else }> extends infer R
|
|
33
|
+
? R extends $Then
|
|
34
|
+
? IsPositive._Positive<T, number, $O>
|
|
35
|
+
: $ResolveBranch<T, $O, [$Else]>
|
|
36
|
+
: never
|
|
37
37
|
: never
|
|
38
38
|
|
|
39
39
|
export namespace IsPositive {
|
|
40
40
|
export type $Options = $Equality.$Options
|
|
41
41
|
export type $Branch<$O extends $Options = {}> = $Equality.$Branch<$O>
|
|
42
42
|
export type _Positive<T, U extends number | bigint, $O extends IsPositive.$Options> = T extends U & infer R
|
|
43
|
-
?
|
|
44
|
-
`${T}` extends `-${string}`
|
|
43
|
+
? `${T}` extends `-${string}`
|
|
45
44
|
? $ResolveBranch<T, $O, [$Else]>
|
|
46
|
-
: U extends T
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
: U extends T
|
|
46
|
+
? $ResolveBranch<T, $O, [$Then]> | $ResolveBranch<T, $O, [$Else]>
|
|
47
|
+
: [T, R] extends [R, T]
|
|
48
|
+
? $ResolveBranch<T, $O, [$Then]>
|
|
49
|
+
: $ResolveBranch<number, $O, [$Then]> | $ResolveBranch<T, $O, [$Else]>
|
|
50
50
|
: never
|
|
51
51
|
}
|
package/src/object/ANotB.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { KeysWithDiffType } from './KeysWithDiffType.js'
|
|
|
6
6
|
export type ANotB<A extends AnyRecord, B extends AnyRecord> = IsEqual<A, B> extends true
|
|
7
7
|
? never
|
|
8
8
|
: IsDisjoint<A, B> extends true
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
? A
|
|
10
|
+
: { [k in Exclude<keyof A, keyof B> | KeysWithDiffType<A, B>]: A[k] }
|
|
11
11
|
|
|
12
12
|
export type BNotA<A extends AnyRecord, B extends AnyRecord> = ANotB<B, A>
|
package/src/object/IsDisjoint.ts
CHANGED
|
@@ -6,7 +6,4 @@ import type { HasKey } from './hasKey.js'
|
|
|
6
6
|
* Are the two records disjoint from each other.
|
|
7
7
|
* Disjoint means no common property.
|
|
8
8
|
*/
|
|
9
|
-
export type IsDisjoint<A extends AnyRecord, B extends AnyRecord> = And<
|
|
10
|
-
Not<HasKey<A, keyof B>>,
|
|
11
|
-
Not<HasKey<B, keyof A>>
|
|
12
|
-
>
|
|
9
|
+
export type IsDisjoint<A extends AnyRecord, B extends AnyRecord> = And<Not<HasKey<A, keyof B>>, Not<HasKey<B, keyof A>>>
|
|
@@ -5,5 +5,5 @@ import type { ValueOf } from './ValueOf.js'
|
|
|
5
5
|
export type KeysWithDiffType<A extends AnyRecord, B extends AnyRecord> = IsDisjoint<A, B> extends true
|
|
6
6
|
? never
|
|
7
7
|
: ValueOf<{
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
[k in keyof A & keyof B]: A[k] extends B[k] ? never : k
|
|
9
|
+
}>
|
package/src/object/KnownKeys.ts
CHANGED
|
@@ -8,10 +8,10 @@ import type { PrimitiveTypes } from '../primitive.js'
|
|
|
8
8
|
export type KnownKeys<T> = T extends PrimitiveTypes
|
|
9
9
|
? never
|
|
10
10
|
: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
[K in keyof T]: string extends K ? never : number extends K ? never : K
|
|
12
|
+
} extends { [_ in keyof T]: infer U }
|
|
13
|
+
? // eslint-disable-next-line @typescript-eslint/ban-types
|
|
14
|
+
{} extends U
|
|
15
|
+
? never
|
|
16
|
+
: U
|
|
17
|
+
: never
|
|
@@ -15,11 +15,11 @@ export type RecursiveIntersect<T, U> = T &
|
|
|
15
15
|
(T extends Array<infer Y>
|
|
16
16
|
? Array<Y & U> & U
|
|
17
17
|
: T extends AnyRecord
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
? {
|
|
19
|
+
[P in keyof T]: T[P] extends Array<infer R>
|
|
20
|
+
? Array<RecursiveIntersect<R, U>> & U
|
|
21
|
+
: T[P] extends AnyRecord
|
|
22
|
+
? RecursiveIntersect<T[P], U>
|
|
23
|
+
: T[P] & U
|
|
24
|
+
} & U
|
|
25
|
+
: U)
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { Omit } from '../object/index.js'
|
|
2
2
|
|
|
3
|
-
export type SpreadRecord<A extends Record<any, any>, B extends Record<any, any>> = Omit<
|
|
4
|
-
A,
|
|
5
|
-
Extract<keyof A, keyof B>
|
|
6
|
-
> &
|
|
3
|
+
export type SpreadRecord<A extends Record<any, any>, B extends Record<any, any>> = Omit<A, Extract<keyof A, keyof B>> &
|
|
7
4
|
B
|
package/src/object/facade.ts
CHANGED
|
@@ -38,15 +38,7 @@ export function facade<
|
|
|
38
38
|
P4 extends keyof T,
|
|
39
39
|
P5 extends keyof T,
|
|
40
40
|
P6 extends keyof T
|
|
41
|
-
>(
|
|
42
|
-
subject: T,
|
|
43
|
-
prop1: P1,
|
|
44
|
-
prop2: P2,
|
|
45
|
-
prop3: P3,
|
|
46
|
-
prop4: P4,
|
|
47
|
-
prop5: P5,
|
|
48
|
-
prop6: P6
|
|
49
|
-
): Pick<T, P1 | P2 | P3 | P4 | P5 | P6>
|
|
41
|
+
>(subject: T, prop1: P1, prop2: P2, prop3: P3, prop4: P4, prop5: P5, prop6: P6): Pick<T, P1 | P2 | P3 | P4 | P5 | P6>
|
|
50
42
|
export function facade<
|
|
51
43
|
T extends AnyRecord,
|
|
52
44
|
P1 extends keyof T,
|
package/src/object/getField.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { UnionKeys } from '../union_keys.js'
|
|
2
2
|
|
|
3
|
-
export function getField<T, TX extends Exclude<T, undefined | null>, K extends UnionKeys<TX>>(
|
|
4
|
-
subject: T,
|
|
5
|
-
key: K
|
|
6
|
-
): TX[K]
|
|
3
|
+
export function getField<T, TX extends Exclude<T, undefined | null>, K extends UnionKeys<TX>>(subject: T, key: K): TX[K]
|
|
7
4
|
export function getField<
|
|
8
5
|
T,
|
|
9
6
|
TX extends Exclude<T, undefined | null>,
|
package/src/object/hasKey.ts
CHANGED
|
@@ -3,5 +3,5 @@ import type { AnyRecord } from './any_record.js'
|
|
|
3
3
|
export type HasKey<T, K, Then = true, Else = false> = K extends keyof T ? Then : Else
|
|
4
4
|
|
|
5
5
|
export function hasKey<T extends AnyRecord, K extends string>(subject: T, ...keys: K[]): HasKey<T, K> {
|
|
6
|
-
return !keys.some(key => !subject[key]) as unknown as HasKey<T, K>
|
|
6
|
+
return !keys.some((key) => !subject[key]) as unknown as HasKey<T, K>
|
|
7
7
|
}
|
|
@@ -89,10 +89,12 @@ import type { $Else, $Then } from '../type_plus/branch/$selection.js'
|
|
|
89
89
|
* type R = IsNotObject<string, $SelectionBranch> // $Then
|
|
90
90
|
* ```
|
|
91
91
|
*/
|
|
92
|
-
export type IsNotObject<T, $O extends IsNotObject.$Options = {}> = $SpecialType<
|
|
93
|
-
|
|
92
|
+
export type IsNotObject<T, $O extends IsNotObject.$Options = {}> = $SpecialType<
|
|
93
|
+
T,
|
|
94
|
+
$MergeOptions<
|
|
95
|
+
$O,
|
|
94
96
|
{
|
|
95
|
-
$then: $ResolveBranch<T, $O, [$Then]
|
|
97
|
+
$then: $ResolveBranch<T, $O, [$Then]>
|
|
96
98
|
$else: IsNotObject.$<T, $O>
|
|
97
99
|
}
|
|
98
100
|
>
|
|
@@ -109,24 +111,29 @@ export namespace IsNotObject {
|
|
|
109
111
|
* This is a type util for building custom types.
|
|
110
112
|
* It does not check against special types.
|
|
111
113
|
*/
|
|
112
|
-
export type $<T, $O extends $UtilOptions> =
|
|
113
|
-
$
|
|
114
|
-
? $IsDistributive<$O, { $then: _D<T, $O>, $else: _N<T, $O> }>
|
|
114
|
+
export type $<T, $O extends $UtilOptions> = $ResolveOptions<[$O['exact'], $Exact.$Default]> extends true
|
|
115
|
+
? $IsDistributive<$O, { $then: _D<T, $O>; $else: _N<T, $O> }>
|
|
115
116
|
: NotAssignable.$<T, object, $O>
|
|
116
117
|
export type $UtilOptions = NotAssignable.$UtilOptions & $Exact.$Options
|
|
117
118
|
|
|
118
119
|
export type _D<T, $O extends $UtilOptions> = T extends object
|
|
119
|
-
? IdentityEqual<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
$
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
? IdentityEqual<
|
|
121
|
+
T,
|
|
122
|
+
{},
|
|
123
|
+
$ResolveBranch<T, $O, [$Then]>,
|
|
124
|
+
IsNever<
|
|
125
|
+
keyof T,
|
|
126
|
+
{
|
|
127
|
+
$then: $ResolveBranch<T, $O, [$Else]>
|
|
128
|
+
$else: $ResolveBranch<T, $O, [$Then]>
|
|
129
|
+
}
|
|
130
|
+
>
|
|
131
|
+
>
|
|
125
132
|
: $ResolveBranch<T, $O, [$Then]>
|
|
126
133
|
|
|
127
|
-
export type _N<T, $O extends $UtilOptions> =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
134
|
+
export type _N<T, $O extends $UtilOptions> = [T] extends [object & infer U]
|
|
135
|
+
? U extends object
|
|
136
|
+
? $ResolveBranch<T, $O, [$Then]>
|
|
137
|
+
: $ResolveBranch<T, $O, [$Else]>
|
|
131
138
|
: $ResolveBranch<T, $O, [$Then]>
|
|
132
139
|
}
|
package/src/object/is_object.ts
CHANGED
|
@@ -76,10 +76,12 @@ import type { $Else, $Then } from '../type_plus/branch/$selection.js'
|
|
|
76
76
|
* type R = IsObject<string, $SelectionBranch> // $Else
|
|
77
77
|
* ```
|
|
78
78
|
*/
|
|
79
|
-
export type IsObject<T, $O extends IsObject.$Options = {}> = $SpecialType<
|
|
80
|
-
|
|
79
|
+
export type IsObject<T, $O extends IsObject.$Options = {}> = $SpecialType<
|
|
80
|
+
T,
|
|
81
|
+
$MergeOptions<
|
|
82
|
+
$O,
|
|
81
83
|
{
|
|
82
|
-
$then: $ResolveBranch<T, $O, [$Else]
|
|
84
|
+
$then: $ResolveBranch<T, $O, [$Else]>
|
|
83
85
|
$else: IsObject.$<T, $O>
|
|
84
86
|
}
|
|
85
87
|
>
|
|
@@ -97,23 +99,29 @@ export namespace IsObject {
|
|
|
97
99
|
* This is a type util for building custom types.
|
|
98
100
|
* It does not check against special types.
|
|
99
101
|
*/
|
|
100
|
-
export type $<T, $O extends $UtilOptions> =
|
|
101
|
-
$
|
|
102
|
-
? $IsDistributive<$O, { $then: _D<T, $O>, $else: _N<T, $O> }>
|
|
102
|
+
export type $<T, $O extends $UtilOptions> = $ResolveOptions<[$O['exact'], $Exact.$Default]> extends true
|
|
103
|
+
? $IsDistributive<$O, { $then: _D<T, $O>; $else: _N<T, $O> }>
|
|
103
104
|
: Assignable.$<T, object, $O>
|
|
104
105
|
export type $UtilOptions = Assignable.$UtilOptions & $Exact.$Options
|
|
105
106
|
|
|
106
107
|
export type _D<T, $O extends $UtilOptions> = T extends object
|
|
107
|
-
? IdentityEqual<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
$
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
? IdentityEqual<
|
|
109
|
+
T,
|
|
110
|
+
{},
|
|
111
|
+
$ResolveBranch<T, $O, [$Else]>,
|
|
112
|
+
IsNever<
|
|
113
|
+
keyof T,
|
|
114
|
+
{
|
|
115
|
+
$then: $ResolveBranch<T, $O, [$Then]>
|
|
116
|
+
$else: $ResolveBranch<T, $O, [$Else]>
|
|
117
|
+
}
|
|
118
|
+
>
|
|
119
|
+
>
|
|
113
120
|
: $ResolveBranch<T, $O, [$Else]>
|
|
114
121
|
|
|
115
|
-
export type _N<T, $O extends $UtilOptions> = [T] extends [object & infer U]
|
|
116
|
-
U extends object
|
|
117
|
-
|
|
122
|
+
export type _N<T, $O extends $UtilOptions> = [T] extends [object & infer U]
|
|
123
|
+
? U extends object
|
|
124
|
+
? $ResolveBranch<T, $O, [$Else]>
|
|
125
|
+
: $ResolveBranch<T, $O, [$Then]>
|
|
118
126
|
: $ResolveBranch<T, $O, [$Else]>
|
|
119
127
|
}
|
package/src/object/left_join.ts
CHANGED
|
@@ -6,5 +6,5 @@ import type { Properties } from './properties.js'
|
|
|
6
6
|
export type LeftJoin<A extends AnyRecord, B extends AnyRecord> = IsEqual<A, B> extends true
|
|
7
7
|
? A
|
|
8
8
|
: IsDisjoint<A, B> extends true
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
? A & B
|
|
10
|
+
: Properties<{ [k in Exclude<keyof A, keyof B>]: A[k] } & { [k in keyof B]: B[k] }>
|