Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/ahh/src/option/mod.ts>O.unwrap

Idiomatic type-safety structures for TypeScript.
Go to Latest
method O.unwrap
import { O } from "https://deno.land/x/ahh@v0.9.1/src/option/mod.ts";

Returns the contained Some value.

Throws if the Option is a None.

Examples

import { O, None } from "./mod.ts";

console.log(O.unwrap(1)); // 1
O.unwrap(None); // throws

Returns

o extends Some<T> ? T : never