From fb73fd6779ad36f221b67847ec3ad8e1c4e88890 Mon Sep 17 00:00:00 2001 From: "volkov.vladislav" Date: Tue, 11 Apr 2017 15:25:58 +0300 Subject: [PATCH] Refactoring --- src/core/watcher-helper.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/watcher-helper.ts b/src/core/watcher-helper.ts index 237189275..2e1a441f3 100644 --- a/src/core/watcher-helper.ts +++ b/src/core/watcher-helper.ts @@ -39,8 +39,10 @@ export class WatcherHelper { } private _isDifferentValues(oldValue: any, newValue: any, deepCheck: boolean) { - if (deepCheck && newValue instanceof (Object) && oldValue instanceof (Object) && - !(oldValue instanceof Date && newValue instanceof Date)) { + let isObjectValues = newValue instanceof Object && oldValue instanceof Object, + isDateValues = oldValue instanceof Date && newValue instanceof Date; + + if (deepCheck && isObjectValues && !isDateValues) { return this._checkObjectsFields(newValue, oldValue); } return oldValue !== newValue;