Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ahh/mod.ts>O.unwrap

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

Returns opt if it is a Some, or throws.

Examples

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

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

Returns

opt extends Some<T> ? T : never