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) • 302 B
TypeScript
import type { Nullable } from '../../nullable/core/nullable.js';
import { type Undefinable } from '../core/undefinable.js';
/**
* Return `null` if _input_ is `undfined`.
* Otherwise, return `T` directly.
*/
export declare function toNullableFromUndefinable<T>(input: Undefinable<T>): Nullable<T>;