Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ahh/src/option.ts>zip

Opinionated idiomatic features for TypeScript.
Latest
function zip
import { zip } from "https://deno.land/x/ahh@v0.14.0/src/option.ts";

Returns the values of option and other as a tuple if both are Somes.

Examples

Example 1

import { assert, assertArrayIncludes } from "../test_deps.ts";
import O from "./option.ts";

const zipped = O.zip(2, "hello");

assert(O.isSome(zipped));
assertArrayIncludes(zipped, [2, "hello"]);

Parameters

option: Option<T>
other: Option<U>