Skip to main content
Module

x/ahh/mod.ts>R.containsErr

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

Returns whether res strictly equals value, or false if it is an Ok.

This only checks whether res and value have the same name and message.

Examples

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

console.log(R.containsErr(1, Error())); // false
console.log(R.containsErr(Error(), Error())); // true
console.log(R.containsErr(Error(), Error("nope"))); // false

Type Parameters

T
E extends Error

Parameters

res: Result<T, E>
value: E

Returns

boolean