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

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

Idiomatic type-safety structures for TypeScript.
Go to Latest
method R.contains
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 Err.

Examples

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

console.log(R.contains(1, 1)); // true
console.log(R.contains(1, 2)); // false
console.log(R.contains(Error(), 1)); // false

Type Parameters

T
E extends Error

Parameters

res: Result<T, E>
value: T

Returns

boolean