The source result.
The success value if exists.
import { err, ok, optionOk, orElse } from "./result.ts";
import { some, none } from "./option.ts";
import { assertEquals } from "../deps.ts";
assertEquals(optionOk(ok(2)), some(2));
assertEquals(optionOk(err("nothing left")), none());
Generated using TypeDoc
Takes the success value as an optional if the result is an
Ok
, otherwise returnsNone
.