Type alias NeverFallback<MaybeNever, Fallback>

NeverFallback<MaybeNever, Fallback>: Single<MaybeNever> extends Single<never> ? Fallback : MaybeNever

Takes a value that could be never, and if it is never it goes to the Fallback value.

Example

const value: never = (undefined as never);
NeverFallback<typeof value, number>; // Will be number

Type Parameters

  • MaybeNever

  • Fallback