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

x/rimbu/common/internal.ts>Eq.anyDeepEq

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

Returns an Eq instance that checks equality of any values. For composed values (objects and iterables) it will recursively compare the contained values.

Examples

Example 1

const eq = anyFlatEq()
console.log(eq(1, 'a'))
// => false
console.log(eq({ a: 1, b: 2 }, { b: 2, a: 1 }))
// => true
console.log(eq([{ a: 1, b: 2 }], [{ b: 2, a: 1 }]))
// => false

Type Parameters

optional
T = any