Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/ahh/src/result/mod.ts>inspectErr

Opinionated idiomatic type-safety functions.
Go to Latest
function inspectErr
import { inspectErr } from "https://deno.land/x/ahh@v0.11.0/src/result/mod.ts";

Calls f with res, and returns the original res.

Examples

Example 1

import { default as 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