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

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

Idiomatic type-safety structures for TypeScript.
Go to Latest
method R.containsErr
import { R } from "https://deno.land/x/ahh@v0.10.0/src/result/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