Skip to main content
Module

x/evt/tools/inDepth/same.ts>same

💧EventEmitter's typesafe replacement
Go to Latest
variable same
import { same } from "https://deno.land/x/evt@v2.4.3/tools/inDepth/same.ts";

Function that perform a in depth comparison of two things of arbitrary type T to see if they represent the same date regardless of object references.

Think of it as JSON.stringify(o1) === JSON.stringify(o2) but unlike a test performed with JSON.stringify the order in the property have been assigned to an object does not matter and circular references are supported.

If takeIntoAccountArraysOrdering === false then representsSameData(["a", "b"], ["b", "a"]) will return true.

If Date are compared via .getTime()

The objects can includes Map and Set.