Skip to main content
Module

x/ahh/mod.ts>O.and

Idiomatic type-safety functions.
Go to Latest
method O.and
Re-export
import { O } from "https://deno.land/x/ahh@v0.10.1/mod.ts";

Return other if opt is Some, or None.

Examples

import { O, None } from "./mod.ts";

console.log(O.and(1, 2)); // 2
console.log(O.and(None, 2)); // None
console.log(O.and(2, None)); // None
console.log(O.and(None, None)); // None

Parameters

opt: Option<T>
other: Option<U>