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) 581 B
import type { ZipTransformerFn } from '../internal/function.js'; import { type Maybe, type NotNullOrUndefined } from './maybe.js'; /** * Zips _self_ and another `Maybe` 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 `null` or `undefined`. */ export declare function zipWithForMaybe<T, U, R>(self: Maybe<T>, other: Maybe<U>, transformer: ZipTransformerFn<T, U, NotNullOrUndefined<R>>): Maybe<R>;