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

x/chai/lib/chai/utils/compareByInspect.js>compareByInspect

BDD / TDD assertion framework for node.js and the browser that can be paired with any testing framework.
Latest
function compareByInspect
import { compareByInspect } from "https://deno.land/x/chai@v5.1.2/lib/chai/utils/compareByInspect.js";

.compareByInspect(mixed, mixed)

To be used as a compareFunction with Array.prototype.sort. Compares elements using inspect instead of default behavior of using toString so that Symbols and objects with irregular/missing toString can still be sorted without a TypeError.

Parameters

a

first element to compare

b

second element to compare