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