import { unwrap } from "https://deno.land/x/optio@1.0.0/operators/extract.ts";
Returns the contained Some
value.
Examples
Example 1
Example 1
import { Some } from "https://deno.land/x/optio/spec.ts";
import { unwrap } from "https://deno.land/x/optio/operators/extract.ts";
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
assertEquals(unwrap(Some(0)), 0);
Example 2
Example 2
import { None } from "https://deno.land/x/optio/spec.ts";
import { unwrap } from "https://deno.land/x/optio/operators/extract.ts";
import { assertThrows } from "https://deno.land/std/testing/asserts.ts";
assertThrows(() => unwrap(None));