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

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

Idiomatic type-safety structures for TypeScript.
Go to Latest
method R.ok
import { R } from "https://deno.land/x/ahh@v0.10.0/src/result/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