utils.js: Add new method objectsEqual()

This commit is contained in:
Johannes Meyer 2019-01-10 15:30:05 +01:00
parent 08c879249b
commit 2a5a403573
1 changed files with 8 additions and 0 deletions

View File

@ -352,6 +352,14 @@
return keys; return keys;
}, },
objectsEqual: function equals(obj1, obj2) {
return Object.keys(obj1)
.concat(Object.keys(obj2))
.every(function (key) {
return obj1[key] === obj2[key];
});
},
/** /**
* Cleanup * Cleanup
*/ */