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

x/rimbu/common/mod.ts>Comp.toEq

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function Comp.toEq
import { Comp } from "https://deno.land/x/rimbu@1.0.3/common/mod.ts";
const { toEq } = Comp;

Returns an Eq equality instance thet will return true when the given comp comparable instance returns 0.

Examples

Example 1

const eq = Comp.toEq(Comp.objectComp())
console.log(eq({ a: 1, b: 2 }, { b: 2, a: 1 }))
// => true

Parameters

comp: Comp<T>
  • the Comp comparable instance to convert