Type Alias NarrowToActual<Actual, Expected>

NarrowToActual: Extract<Actual, Expected> extends never
    ? Extract<Expected, Actual> extends never
        ? Expected extends Actual ? Expected : never
        : Extract<Expected, Actual>
    : Extract<Actual, Expected>

Narrows the given Expected type to the given Actual type as much as possible, or falls back to just Expected itself.

Type Parameters

  • Actual
  • Expected