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) • 367 B
TypeScript
import type { AsyncRecoveryFn } from '../../internal/function.js';
import { type Option } from './option.js';
/**
* Unwraps a result _input_, returns the content of an `Some(T)`.
* If the value is an `None` then it calls `def` with its value.
*/
export declare function unwrapOrElseAsyncForOption<T>(input: Option<T>, recoverer: AsyncRecoveryFn<T>): Promise<T>;