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

x/monads/result/result.ts>ResOk

👻 Option, Result, and Either types for TypeScript; Inspired by Rust
Latest
interface ResOk
implements Result<T, E>
import { type ResOk } from "https://deno.land/x/monads@v0.5.10/result/result.ts";

Type Parameters

T
optional
E = never

Methods

unwrap(): T
unwrapOr(optb: T): T
unwrapOrElse(fn: (err: E) => T): T
unwrapErr(): never
match<U>(fn: Match<T, never, U>): U
map<U>(fn: (val: T) => U): ResOk<U, never>
mapErr<U>(fn: (err: E) => U): ResOk<T, never>
andThen<U>(fn: (val: T) => Result<U, E>): Result<U, E>
orElse<U>(fn: (err: E) => Result<U, E>): Result<T, E>