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

x/ahh/src/result/mod.ts>R.mapErr

Idiomatic type-safety structures for TypeScript.
Go to Latest
method R.mapErr
import { R } from "https://deno.land/x/ahh@v0.10.0/src/result/mod.ts";

Calls f with res, and returns the result.

Examples

import { R } from "./mod.ts";

console.log(R.map(1, (_) => Error("new"))); // 1
console.log(R.map(Error(), (_) => Error("new"))); // Error("new")

Type Parameters

T
E extends Error
F extends Error

Parameters

res: Result<T, E>
f: (_: E) => F