deepDiff()function
deepDiff(left: unknown, right: R): R | DeepPartial<R> | typeof SAME
deepDiff(left: unknown, right: R): R | typeof SAME
| Param | Type | |
|---|---|---|
left | unknown | The old value. required |
right | R | The new/target value. required |
left | unknown | required |
right | R | required |
| Return | |
|---|---|
R | DeepPartial<R> | typeof SAME | The transformation needed to transform left into right- If the two values are deeply equal the SAME constant is returned.- Unequal scalar values can't be diffed, so right is always returned.- If right is an array, returns whatever deepDiffArray() returns.- If right is an object, returns whatever deepDiffObject() returns. |
R | typeof SAME |
Deeply diff two unknown values to produce the transformation needed to transform left into right, or the SAME constant if they are deeply equal.
Examples
deepDiff({ a: 1 }, { a: 1 }) // SAMEdeepDiff({ a: 1 }, { a: 2 }) // { a: 2 }