diff --git a/index.html b/index.html index fedd828..610146a 100644 --- a/index.html +++ b/index.html @@ -1,792 +1,848 @@ - - + - Content Collaboration + Content Collaboration - - - - - - -
-
- - -
-
- - -
- - -
- - - - - - - -

- -
- -
-
-
- - + }); + + if(obj.constructor.toString().indexOf("Array") != -1) {obj = obj.filter(function (el) { + return el != null; + });} + + return obj; + } + + /*obj is original object or array, diff is the output of findDifference */ + window.mergeDifference = (obj,diff) => { + if(Object.keys(diff.updated).length !== 0) + obj = mergeRecursive(obj,diff.updated) + if(Object.keys(diff.deleted).length !== 0){ + obj = mergeRecursive(obj,diff.deleted) + obj = cleanse(obj) + } + if(Object.keys(diff.added).length !== 0) + obj = mergeRecursive(obj,diff.added) + return obj + } +})(); + - - + - + - + - + - + + + }).catch(error => console.error(error)) + } + - - \ No newline at end of file +