assertStrictEquals
import { assertStrictEquals } from "jsr:@ende/assert/unstable-strict-equals";function ยท experimental
function assertStrictEquals<T>(actual: unknown, expected: T, msg?: string): asserts actual is TMake an assertion that actual and expected are strictly equal, using
Object.is for equality comparison. If not, then throw.
actual: unknownThe actual value to compare.
expected: TThe expected value to compare.
msg?: stringThe optional message to display if the assertion fails.
Example: Usage
import { assertStrictEquals } from "@ende/assert";
const a = {};
const b = a;
assertStrictEquals(a, b); // Doesn't throw
const c = {};
const d = {};
assertStrictEquals(c, d); // Throws