diff --git a/js/diff.js b/js/diff.js index b5c00efc77c80ed15a9a3cdd2767b00f3141d2a6..98319c2189128e988f0ae0f4bbef16798b5019f4 100644 --- a/js/diff.js +++ b/js/diff.js @@ -2,6 +2,8 @@ * The diff proxy records all changes to the original object without changing the original object while emulating the * changes for access from outside. The resulting diff object can then be applied on the original. The resulting object * is the same as if the changes were applied directly to the original object. + * + * NOTE: When doing any changes to this, rerun the tests cases at devNotes/tests. */ App.Utils.Diff = (function() { const deletedSymbol = Symbol("deleted property"); @@ -64,7 +66,8 @@ App.Utils.Diff = (function() { // Deep copy in case array entries get modified later localDiff[key] = _.cloneDeep(original); } else if (_.isObject(original)) { - localDiff[key] = {}; + // TODO check if there is a way to keep the data structure valid without the need for deep clone + localDiff[key] = _.cloneDeep(original); } } localDiff = localDiff[key];