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

12 lines (11 loc) 634 B
import type { AsyncZipTransformerFn } from '../../internal/function.js'; import { type Undefinable, type NotUndefined } from '../core/undefinable.js'; /** * Zips _self_ and another `Undefinable` with function _transformer_. * If _self_ is `T` and _other_ is `U`, this method returns the result of _transformer_. * Otherwise, `undefined` is returned. * * @throws {TypeError} * Throws if the _transformer_ returns `undefined`. */ export declare function zipWithAsyncForUndefinable<T, U, R>(self: Undefinable<T>, other: Undefinable<U>, transformer: AsyncZipTransformerFn<T, U, NotUndefined<R>>): Promise<Undefinable<R>>;