Skip to content

Optional type ​

A T that may be undefined.

ts
import type { Optional } from 'utils';

Signature ​

ts
export type Optional<T> = T | undefined;

Parameters ​

NameDescription
TThe underlying type.

Tests ​

Line coverage: 0 %.

Source ​

src/types/optional.ts (on GitHub)

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

Keywords: optional, types, type

Generated from the JSDoc of the sources.