fxl
2023-05-04 e150655a785de36a65a26a0dc4d3d6d65fe7e9d0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { defined } from "../Source/Cesium.js";
 
function equalsMethodEqualityTester(a, b) {
  var to_run;
  // if either a or b have an equals method, call it.
  if (a !== null && defined(a)) {
    if (typeof a.equals === "function") {
      return a.equals(b);
    } else if (a instanceof Object) {
      // Check if the current object has a static function named 'equals'
      to_run = Object.getPrototypeOf(a).constructor.equals;
      if (typeof to_run === "function") {
        return to_run(a, b);
      }
    }
  }
 
  if (b !== null && defined(b)) {
    if (typeof b.equals === "function") {
      return b.equals(a);
    } else if (b instanceof Object) {
      // Check if the current object has a static function named 'equals'
      to_run = Object.getPrototypeOf(b).constructor.equals;
      if (typeof to_run === "function") {
        return to_run(b, a);
      }
    }
  }
 
  // fall back to default equality checks.
  return undefined;
}
export default equalsMethodEqualityTester;