Function compareProps

Compare two objects and return an array of the properties that are different. By default, if the first object doesn't have a property at all and the second object has it defined as undefined this will be considered as a difference. To change this behavior, set missingEqualsUndefined option to true.

compareProps({ a: 1, b: 2 }, { a: 1, b: 3 }) // ["b"]
  • Type Parameters

    • T extends Record<string, unknown>

    Parameters

    Returns string[]

    an array of the properties that are different