diff --git a/client/core/src/lib/equals.js b/client/core/src/lib/equals.js index 2e211153e..061d3f7c3 100644 --- a/client/core/src/lib/equals.js +++ b/client/core/src/lib/equals.js @@ -2,47 +2,6 @@ import {module} from '../module'; const isEqual = angular.equals; -export const myEqual = (objA, objB, estrict) => { - let equals = true; - let estrictMode = estrict || true; - - if (Object.keys(objA).length !== Object.keys(objB).length) { - return false; - } - - for (let k in objA) { - if (!objB.hasOwnProperty(k)) { - return false; - } - if (estrictMode) { - if (typeof objA[k] !== typeof objB[k]) { - return false; - } - if (typeof objA[k] !== 'object' && objA[k] !== objB[k]) { - return false; - } - if (typeof objA[k] === 'object') { - equals = myEqual(objA[k], objB[k], estrictMode); - if (!equals) { - return false; - } - } - } else { - if (typeof objA[k] !== 'object' && objA[k] != objB[k]) { - return false; - } - if (typeof objA[k] === 'object') { - equals = myEqual(objA[k], objB[k], estrictMode); - if (!equals) { - return false; - } - } - } - } - - return equals; -}; - export default isEqual; export const NAME = 'equalsObject'; diff --git a/client/core/src/watcher/watcher.js b/client/core/src/watcher/watcher.js index ec541f21d..1c6df4bfa 100644 --- a/client/core/src/watcher/watcher.js +++ b/client/core/src/watcher/watcher.js @@ -2,7 +2,7 @@ import {module} from '../module'; import Component from '../lib/component'; import getModifiedData from '../lib/modified'; import copyObject from '../lib/copy'; -import {myEqual} from '../lib/equals'; +import isEqual from '../lib/equals'; /** * Component that checks for changes on a specific model property and @@ -181,7 +181,7 @@ export default class Watcher extends Component { dataChanged() { let newData = this.copyInNewObject(this.data); - return !myEqual(newData, this.orgData); + return !isEqual(newData, this.orgData); } onConfirmResponse(response) {