Type Alias Widen<T>

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

⚗️ transform

Widen literal types to their respective parent types.

type R = Widen<1> // number
type R = Widen<true> // boolean
type R = Widen<'a'> // string

Type Parameters

  • T