UNPKG

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>`.

10 lines (9 loc) 464 B
import type { AsyncTransformFn } from '../../internal/function.js'; import { type Option } from './option.js'; /** * Maps a `Option<T>` to `Option<U>` by applying a _transformer_ function * to an contained `Some(T)` value, leaving an `None` value untouched. * * This function can be used to compose the results of two functions. */ export declare function mapAsyncForOption<T, U>(input: Option<T>, transformer: AsyncTransformFn<T, U>): Promise<Option<U>>;