Skip to content

Nullish type ​

A T that may be null or undefined.

ts
import type { Nullish } from 'utils';

Signature ​

ts
export type Nullish<T> = T | null | undefined;

Parameters ​

NameDescription
TThe underlying type.

Tests ​

Line coverage: 0 %.

Source ​

src/types/nullish.ts (on GitHub)

Source code
ts
/**
 * A `T` that may be `null` or `undefined`.
 *
 * @template T - The underlying type.
 */
export type Nullish<T> = T | null | undefined;

Keywords: nullish, types, type

Generated from the JSDoc of the sources.