option-t
Version:
A toolkit of Nullable/Option/Result type implementation in ECMAScript. Their APIs are inspired by Rust's `Option<T>` and `Result<T, E>`.
8 lines (7 loc) • 306 B
TypeScript
import type { Undefinable } from '../../undefinable/core/undefinable.js';
import { type Nullable } from '../core/nullable.js';
/**
* Return `undefined` if _input_ is `null`.
* Otherwise, return `T` directly.
*/
export declare function toUndefinableFromNullable<T>(input: Nullable<T>): Undefinable<T>;