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

x/rimbu/core/main/exports.ts>Comp.anyDeepComp

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

Returns a Comp instance that compares any value using default comparison functions. For Iterables and objects, their elements are compared recursively.

Examples

Example 1

const c = Comp.anyDeepComp();
console.log(c.compare({ a: 1, b: 1 }, { b: 1, a: 1 }))
// => 0
console.log(c.compare([{ a: 1, b: 1 }], [{ b: 1, a: 1 }]))
// => 0