Skip to main content
Module

x/ahh/mod.ts>R.inspectErr

Idiomatic type-safety functions.
Go to Latest
method R.inspectErr
import { R } from "https://deno.land/x/ahh@v0.10.1/mod.ts";

Calls f with res, and returns the original res.

Examples

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

console.log(R.inspectErr(1, () => Error("nope"))); // 1
console.log(R.inspectErr(Error(), () => Error("nope"))); // Error()

Type Parameters

T
E extends Error

Parameters

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