Optional type
A T that may be undefined.
ts
import type { Optional } from 'utils';Signature
ts
export type Optional<T> = T | undefined;Parameters
| Name | Description |
|---|---|
T | The 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