Function shallowEquals

  • Shallow equals function at the core of many other comparison functions

    Parameters

    • options: { epsilon?: number; looseTypes?: boolean; subset?: boolean } = {}
      • Optionalepsilon?: number

        Epsilon for number comparison

      • OptionallooseTypes?: boolean

        If true, skip type check (e.g. “5” can match 5)

      • Optionalsubset?: boolean

        If true, undefined is considered equal to anything

    Returns (actual: any, expect: any) => boolean