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

x/eitherway/lib/core/mod.ts>Ok

Yet Another Option and Result Implementation - providing safe abstractions for fallible flows inspired by F# and Rust
Latest
type alias Ok
import { type Ok } from "https://deno.land/x/eitherway@0.10.0/lib/core/mod.ts";

Ok

The success variant of a Result<T, E>

Examples

Example 1

import { assert } from "./assert.ts";
import { Err, Ok, Result } from "./result.ts";

const ok = Ok(42);
const tag = Object.prototype.toString.call(Ok);

assert(ok instanceof Ok);
assert(ok instanceof Result);
assert(tag === "[object eitherway::Result::Ok]");
definition: _Ok<T>
function Ok
import { Ok } from "https://deno.land/x/eitherway@0.10.0/lib/core/mod.ts";