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

x/ahh/src/result/mod.ts>R.unwrap

Idiomatic type-safety functions.
Go to Latest
method R.unwrap
import { R } from "https://deno.land/x/ahh@v0.10.3/src/result/mod.ts";

Returns res if it is an Ok, or throws.

Examples

Example 1

import { R } from "./mod.ts";

console.log(R.unwrap(1)); // 1
R.unwrap(Error()); // throws

Type Parameters

T
E extends Error

Returns

res extends Ok<T> ? T : never