Skip to content

Commit

Permalink
Fix comparison bug in case of NULL values
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierdalang authored Nov 8, 2021
1 parent 74ba95c commit 825cba2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/CompareApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1458,15 +1458,15 @@ class CompareApi {
}

/**
*
* Returns true if there is a difference between source and target vlue
* @param {Object} sourceValue
* @param {Object} targetValue
*/
static compareFieldValues(sourceValue, targetValue) {
var sourceValueType = typeof sourceValue;
var targetValueType = typeof targetValue;

if (sourceValueType != targetValueType) return false;
if (sourceValueType != targetValueType) return true;
else if (sourceValue instanceof Date) return sourceValue.getTime() !== targetValue.getTime();
else if (sourceValue instanceof Object) return !deepEqual(sourceValue, targetValue);
else return sourceValue !== targetValue;
Expand Down

0 comments on commit 825cba2

Please sign in to comment.