@nospamproxy/core
    Preparing search index...

    Generic object comparator implementation.

    Index

    Constructors

    Methods

    • Deep compares 2 objects and returns the delta object.

      Type Parameters

      • T

      Parameters

      Returns Partial<T>

    • Parameters

      • value1: unknown

        The first value to compare.

      • value2: unknown

        The second value to compare.

      • Optionaloptions: Readonly<ComparatorOptions<any>>

        The options to use for comparison.

      • Optionalkey: string

        An optional key that the values are stored under. This is used to determine if the values are dates and should be normalized according to the specified options.

      Returns boolean | UnsupportedComparisonValue

      true if both values are deep equal, null (inconclusive) if values are function, false otherwise.

      Note on 'inconclusive': if value1 or value2 are arrays or objects, and has a function as a value at any depth is considered not-equal. As this is primarily conceptualized for using with OData patch, such edge cases are ignored.

    • Normalizes a date value for comparison.

      Parameters

      • value: unknown

      Returns number | null