Takes a value that could be never, and if it is never it goes to the Fallback value.
never
Fallback
There are some scenarios where a value can end up being of type never, this works sorta like the the ?? operator, but for never.
??
const value: never = (undefined as never);NeverFallback<typeof value, number>; // Will be number Copy
const value: never = (undefined as never);NeverFallback<typeof value, number>; // Will be number
The type that may or may not be never.
The fallback type to use if MaybeNever is never.
MaybeNever
Takes a value that could be
never
, and if it isnever
it goes to theFallback
value.Remarks
There are some scenarios where a value can end up being of type
never
, this works sorta like the the??
operator, but fornever
.Example