2024-02-06 07:41:42 +00:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
|
2024-02-27 21:57:25 +00:00
|
|
|
import type { Tester } from "./_types.ts";
|
2024-02-06 07:41:42 +00:00
|
|
|
|
|
|
|
const customEqualityTesters: Tester[] = [];
|
|
|
|
|
|
|
|
export function addCustomEqualityTesters(newTesters: Tester[]) {
|
|
|
|
if (!Array.isArray(newTesters)) {
|
|
|
|
throw new TypeError(
|
|
|
|
`customEqualityTester expects an array of Testers. But got ${typeof newTesters}`,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
customEqualityTesters.push(...newTesters);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getCustomEqualityTesters() {
|
|
|
|
return customEqualityTesters;
|
|
|
|
}
|