devtypes
    Preparing search index...

    Type Alias Narrow<T>

    Narrow: T extends string
        ? string extends T ? T : T
        : T extends number ? number extends T ? T : T : T

    Narrow a type to a specific subtype (useful for literal narrowing)

    Type Parameters

    • T
    type A = Narrow<"hello">; // "hello"
    type B = Narrow<string>; // string