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

x/monads/result/result.ts>ResErr

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

Methods

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