import { unwrapErr } from "https://deno.land/x/result_js@2.0.0/operators/extract.ts";
Returns the contained Err
value.
Examples
Example 1
Example 1
import { Err } from "https://deno.land/x/result_js/spec.ts";
import { unwrapErr } from "https://deno.land/x/result_js/operators/extract.ts";
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
assertEquals(unwrapErr(Err(0)), 0);
Example 2
Example 2
import { Ok } from "https://deno.land/x/result_js/spec.ts";
import { unwrapErr } from "https://deno.land/x/result_js/operators/extract.ts";
import { assertThrows } from "https://deno.land/std/testing/asserts.ts";
assertThrows(() => unwrapErr(Ok(0)));