On this page
  1. NonNullable
  2. Syntax & Overview
  3. Notes & Pitfalls
  4. Example

NonNullable

Prev: `Extract` | Up: union_and_nullability | Next: function_and_promise
Rel: union_and_nullability, Conditional & Mapped Types
Ref: TypeScript Docs — Utility Types
Tags: #public #web #typescript #utility-types #union_and_nullability #tier/core


Syntax & Overview

NonNullable<T>

Removes null and undefined from T.

Notes & Pitfalls

Example

type RawId = string | null | undefined;
type CleanId = NonNullable<RawId>; // string

Linked from

Related notes