Tweakr
    Preparing search index...

    Function deepEqual

    • Performs a deep equality check between two values, handling nested objects, arrays, Maps, Sets, Dates, RegExps, and circular references.

      Optimizations for v1.2.0:

      • Object key comparison uses a Set for O(1) lookups.
      • Arrays short-circuit on primitive equality.
      • Optional deep equality for Sets of objects.
      • Early exit for mismatched types (Array vs Object, Map vs Object, etc.).

      Parameters

      • a: any

        The first value to compare.

      • b: any

        The second value to compare.

      • seen: WeakMap<WeakKey, any> = ...

        Internal WeakMap to handle circular references (do not provide manually).

      Returns boolean

      true if the values are deeply equal, otherwise false.

      1.1.0