Improve diff display in case the whole key in missing

This commit is contained in:
Guillaume Gomez 2021-02-01 11:27:17 +01:00
parent d5243e3a97
commit c013f2a735
1 changed files with 4 additions and 0 deletions

View File

@ -203,6 +203,10 @@ function betterLookingDiff(entry, data) {
if (!entry.hasOwnProperty(key)) {
continue;
}
if (!data || !data.hasOwnProperty(key)) {
output += '-' + spaces + contentToDiffLine(key, entry[key]) + '\n';
continue;
}
let value = data[key];
if (value !== entry[key]) {
output += '-' + spaces + contentToDiffLine(key, entry[key]) + '\n';