Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/ahh/mod.ts>R.ok

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

Converts res into a Some if it is an Ok.

Examples

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

console.log(R.ok(1)); // 1
console.log(R.ok(Error())); // undefined

Type Parameters

T
E extends Error