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>unwrap

Opinionated idiomatic type-safety functions.
Go to Latest
function unwrap
import { unwrap } from "https://deno.land/x/ahh@v0.11.0/src/option/mod.ts";

Returns opt if it is a Some, or throws.

Examples

Example 1

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

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

Returns

opt extends Some<T> ? T : never