NotUndefined

NotUndefined<Type>

A generic type NotUndefined represents any type instead of undefined. It takes generic type variable Type constrained by undefined which constraint causes its change to never.

not-undefined.type.ts
type NotUndefined<Type> = Type extends undefined ? never : Type;

Generic type variables

Type

A generic type Type that is never undefined.

Last updated