@metreeca/core - v0.9.19
    Preparing search index...

    Function equals

    • Checks deep object equality.

      Object pairs are deeply equal if they contain:

      • two plain objects with deeply equal entry sets
      • two arrays with pairwise deeply equal items
      • two values otherwise equal according to equal or Object.is by default
      Caution

      Circular references are not supported. Do not pass objects with cycles.

      Note

      Reference-identical arguments (Object.is(x, y)) short-circuit immediately, skipping deep traversal entirely. This optimisation is unconditional and independent of the custom equal function.

      Parameters

      • x: unknown

        The target object to be checked for equality

      • y: unknown

        The reference object to be checked for equality

      • equal: (x: unknown, y: unknown) => boolean = Object.is

        An optional custom equality function for comparing non-object, non-array values; defaults to Object.is

      Returns boolean

      true if x and y are deeply equal; false otherwise

      Stack overflow when x or y contains circular references