Skip to main content
Module

x/eitherway/mod.ts>Ok

Yet Another Option and Result Implementation - providing safe abstractions for fallible flows inspired by F# and Rust
Latest
type alias Ok
Re-export
import { type Ok } from "https://deno.land/x/eitherway@0.10.0/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
Re-export
import { Ok } from "https://deno.land/x/eitherway@0.10.0/mod.ts";