utilitypes-ts
    Preparing search index...

    Type Alias Unbind<T>

    Unbind: Omit<Normalize<T>, never>

    Collapses a union type into a single object type by merging all members.

    Each property becomes:

    • A union of all possible value types across the union members
    • Optional if it does not exist in every member

    This effectively removes the relationship between fields (i.e. "unbinds" discriminated unions), making all properties independent.

    Type Parameters

    • T

      The target union type

    type Result = Unbind<
    | { kind: "success"; data: string }
    | { kind: "error"; error: Error }
    >;
    // ^?
    // {
    // kind: "success" | "error";
    // data?: string;
    // error?: Error;
    // }