The fallback optional.
optA
or optB
.
import { or, some, none } from "./option.ts";
import { assertEquals } from "../deps.ts";
assertEquals(or(none())(none()), none());
assertEquals(or(none())(some(2)), some(2));
assertEquals(or(some(100))(none()), some(100));
assertEquals(or(some(100))(some(2)), some(2));
Generated using TypeDoc
Returns the optional
optA
if it contains a value, otherwise returnsoptB
. The order of arguments is reversed because of that it is useful for partial applying.