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) • 403 B
TypeScript
import { type Maybe, type NotNullOrUndefined } from '../core/maybe.js';
/**
* Zips _self_ with another `Maybe<T>`.
* If _self_ is `T` and _other_ is `U`, this method returns `[NotNullOrUndefined<T>, NotNullOrUndefined<U>]`.
* Otherwise, `undefined` is returned.
*/
export declare function zipForMaybe<T, U>(self: Maybe<T>, other: Maybe<U>): Maybe<[NotNullOrUndefined<T>, NotNullOrUndefined<U>]>;