Type Alias Merge<A, B>

Merge: Or<
    IsNever<A>,
    IsNever<B>,
    {
        $else: Or<
            IsVoid<A>,
            IsVoid<B>,
            {
                $else: Or<
                    IsUnknown<A>,
                    Or<IsUndefined<A>, IsNull<A>>,
                    {
                        $else: Or<
                            IsUnknown<B>,
                            Or<IsUndefined<B>, IsNull<B>>,
                            {
                                $else: ObjectPlus.Merge<
                                    Box<A, { $notBoxable: ... }>,
                                    Box<B, { $notBoxable: ... }>,
                                >;
                                $then: A;
                            },
                        >;
                        $then: B;
                    },
                >;
                $then: A & B;
            },
        >;
        $then: never;
    },
>

⚗️ transform 🔢 customizable

Merges type A and type B.

This type performs the same operations as { ...a, ...b } but at the type level.

This is a more general type then ObjectPlus.Merge<A, B>, which constraints A and B to be Record.

This type does not have such restrictions, and tries to handle the other types accordingly.

Type Parameters

  • A
  • B