(leftValue, rightValue, formatter = (value) => String(value))
| 1075 | } |
| 1076 | |
| 1077 | function valuesDiffer(leftValue, rightValue, formatter = (value) => String(value)) { |
| 1078 | const leftMissing = !hasValue(leftValue); |
| 1079 | const rightMissing = !hasValue(rightValue); |
| 1080 | if (leftMissing || rightMissing) { |
| 1081 | return leftMissing !== rightMissing; |
| 1082 | } |
| 1083 | return formatter(leftValue) !== formatter(rightValue); |
| 1084 | } |
| 1085 | |
| 1086 | function buildCompareTone(leftValue, rightValue, formatter = (value) => String(value)) { |
| 1087 | const changed = valuesDiffer(leftValue, rightValue, formatter); |
no test coverage detected