Skip to content

Commit 49e6212

Browse files
authored
Use triple equals for dates
Not sure what would need to be coerced here, triple equals might help ensure a more accurate diff. ```js const date1 = new Date(Date.UTC(96, 1, 2, 3, 4, 5)); console.log(date1.valueOf()); // expected output: 823230245000 const date2 = new Date("02 Feb 1996 03:04:05 GMT"); console.log(date2.valueOf()); // expected output: 823230245000 console.log(date1.valueOf() === date2.valueOf()); // expected output: true ```
1 parent 6296889 commit 49e6212

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/diff/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const diff = (lhs, rhs) => {
1313
}, {});
1414

1515
if (isDate(l) || isDate(r)) {
16-
if (l.valueOf() == r.valueOf()) return {};
16+
if (l.valueOf() === r.valueOf()) return {};
1717
return r;
1818
}
1919

0 commit comments

Comments
 (0)