Skip to content

Commit

Permalink
Merge pull request vitmalina#1976 from mpf82/fix-w2form.getChanges()
Browse files Browse the repository at this point in the history
fix w2form.getChanges()
  • Loading branch information
vitmalina authored Mar 18, 2021
2 parents 0227bb6 + 5131ec8 commit f4120b0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/w2form.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,11 @@
return diff;

function doDiff(record, original, result) {
if(Array.isArray(record) && Array.isArray(original)){
while(record.length < original.length){
record.push(null)
}
}
for (var i in record) {
if (record[i] != null && typeof record[i] === "object") {
result[i] = doDiff(record[i], original[i] || {}, {});
Expand Down

0 comments on commit f4120b0

Please sign in to comment.