Skip to content

Commit 279a09e

Browse files
committed
fix: fix bug from #120 that appeared in production bundle only
1 parent d6a6fb1 commit 279a09e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/logger.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ function formatTime(time) {
3939
}
4040

4141
// Use performance API if it's available in order to get better precision
42-
const timer = typeof performance?.now === 'function' ? performance : Date;
42+
// performance can be null, performance?.now won't work here!
43+
const timer =
44+
(typeof performance || {}).now === 'function' ? performance : Date;
4345

4446
function renderDiff(diff) {
4547
const { kind, path, lhs, rhs, index, item } = diff;

0 commit comments

Comments
 (0)