Skip to content

Commit 4fa76c5

Browse files
author
Phillip Clark
committed
fixed lingering .toString issue, exposed in browser, not command line
1 parent c62e8c0 commit 4fa76c5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

index.es.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function deepDiff(lhs, rhs, changes, prefilter, path, key, stack) {
151151
changes(new DiffDeleted(currentPath, lhs));
152152
} else if (realTypeOf(lhs) !== realTypeOf(rhs)) {
153153
changes(new DiffEdit(currentPath, lhs, rhs));
154-
} else if (Object.prototype.toString.call(lhs) === '[object Date]' && Object.prototype.toString.call(rhs) === '[object Date]' && ((lhs - rhs) !== 0)) {
154+
} else if (realTypeOf(lhs) === 'date' && (lhs - rhs) !== 0) {
155155
changes(new DiffEdit(currentPath, lhs, rhs));
156156
} else if (ltype === 'object' && lhs !== null && rhs !== null) {
157157
stack = stack || [];

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ function deepDiff(lhs, rhs, changes, prefilter, path, key, stack) {
158158
changes(new DiffDeleted(currentPath, lhs));
159159
} else if (realTypeOf(lhs) !== realTypeOf(rhs)) {
160160
changes(new DiffEdit(currentPath, lhs, rhs));
161-
} else if (Object.prototype.toString.call(lhs) === '[object Date]' && Object.prototype.toString.call(rhs) === '[object Date]' && ((lhs - rhs) !== 0)) {
161+
} else if (realTypeOf(lhs) === 'date' && (lhs - rhs) !== 0) {
162162
changes(new DiffEdit(currentPath, lhs, rhs));
163163
} else if (ltype === 'object' && lhs !== null && rhs !== null) {
164164
stack = stack || [];

0 commit comments

Comments
 (0)