ts-type-forge
    Preparing search index...

    Type Alias ToString<A>

    ToString: A extends number ? `${A}` : A

    Converts a type A to its string representation if it's a number, otherwise returns A.

    Type Parameters

    • A

      The type to convert.

    type Str = ToString<123>; // "123"
    type Bool = ToString<boolean>; // boolean