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

x/result_js/operators/transform.ts

Minimum result type port of Rust
Latest
import * as resultJs from "https://deno.land/x/result_js@2.0.0/operators/transform.ts";

Functions

Maps a Result<T, | E> to Result<U, | E> by applying fn to a contained Ok, leaving an Err.

Maps a Result<T, | E> to Result<T, | F> by applying fn to a contained Err value, leaving an Ok.

Returns the provided defaultValue (if Err), or applies fn to the contained value (if Ok),

Maps a Result<T, | E> to U by applying defaultFn to a contained Err, or fn to a contained Ok.