Function diffObjects

  • Extract all nested object keys and values that are different between the two given objects.

    Type Parameters

    • T0 extends Readonly<Record<PropertyKey, unknown>>
    • T1 extends Readonly<Record<PropertyKey, unknown>>

    Parameters

    • object0: T0
    • object1: T1

    Returns [PartialDeep<T0>, PartialDeep<T1>] | []

    An empty tuple if the values are equal. Otherwise, the first tuple entry contains the changes in the first value, second entry contains the changes in the second value.