Skip to main content
Module

x/rimbu/mod.ts>Eq.anyJsonEq

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

Returns an Eq instance that considers values equal their JSON.stringify values are equal.

Examples

Example 1

const eq = Eq.anyJsonEq()
console.log(eq({ a: 1, b: 2 }, { a: 1, b: 2 }))
// => true
console.log(eq({ a: 1, b: 2 }, { b: 2, a: 1 }))
// => false