From 2a5a403573517fba170a362cf0a8f8fa464daf4f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 10 Jan 2019 15:30:05 +0100 Subject: [PATCH] utils.js: Add new method objectsEqual() --- public/js/icinga/utils.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/js/icinga/utils.js b/public/js/icinga/utils.js index 8c69485e1..6360a9b77 100644 --- a/public/js/icinga/utils.js +++ b/public/js/icinga/utils.js @@ -352,6 +352,14 @@ return keys; }, + objectsEqual: function equals(obj1, obj2) { + return Object.keys(obj1) + .concat(Object.keys(obj2)) + .every(function (key) { + return obj1[key] === obj2[key]; + }); + }, + /** * Cleanup */