NonNullable is a utility type in Typescript that excludes null and undefined from a type.

Example

type ExampleResponse = NonNullable< string | boolean | undefined | null>; //type ExampleResponse = string | boolean

As you can from the above example, the NonNullable type automatically strips out undefined and null.