All files / expect / _custom_equality_tester.ts

50.00% Branches 1/2
100.00% Functions 2/2
63.64% Lines 7/11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
 
 
 
x108
 
x108
 
 
 
 
 
 
x3
x3
 
x108
x776
x776






I










// Copyright 2018-2026 the Deno authors. MIT license.

import type { Tester } from "./_types.ts";

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;
}