Variable ValuesConst

Values: {
    compare(x, y) => number;
    equal(x, y) => boolean;
    equivalent(x, y, epsilon?) => boolean;
    hash(x) => number;
}

Utilities for comparing and hashing structural values. A structural value is typed by object structure, rather than by name.

Type declaration

  • compare:function
    • Returns -1 if x orders before y; returns 1 if x orders after y; returns 0 if x and y are equivalent; and returns NaN if x is not comparable to y.

      Parameters

      • x: unknown
      • y: unknown

      Returns number

  • equal:function
    • Returns true if x and y are structurally equal, otherwise returns false.

      Parameters

      • x: unknown
      • y: unknown

      Returns boolean

  • equivalent:function
    • Returns true if x and y are structurally equivalent, otherwise returns false.

      Parameters

      • x: unknown
      • y: unknown
      • Optional epsilon: number

      Returns boolean

  • hash:function
    • Returns a hash code for a structural value.

      Parameters

      • x: unknown

      Returns number

Generated using TypeDoc