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

8 lines (7 loc) 364 B
import { type Nullable, type NotNull } from '../core/nullable.js'; /** * Zips _self_ with another `Nullable<T>`. * If _self_ is `T` and _other_ is `U`, this method returns `[NotNull<T>, NotNull<U>]`. * Otherwise, `null` is returned. */ export declare function zipForNullable<T, U>(self: Nullable<T>, other: Nullable<U>): Nullable<[NotNull<T>, NotNull<U>]>;