@jossmac/lil-libs
    Preparing search index...

    Type Alias Widen<T>

    Widen: T extends string
        ? string
        : T extends number ? number : T extends boolean ? boolean : T

    Widens string, number, and boolean literal types to their primitive base; all other types pass through unchanged.

    Type Parameters

    • T

      Literal or narrow type to widen.

    type A = Widen<"hello">;
    // ^? string
    type B = Widen<42>;
    // ^? number
    type C = Widen<true>;
    // ^? boolean