Skip to content

Commit 9fb6114

Browse files
committed
fix: process is not defined in browser environment (#806)
1 parent a0b6e21 commit 9fb6114

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/utils/log.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/*eslint no-console:0*/
2-
export default function log(...args: unknown[]): void {
3-
if (process.env.DRAGGABLE_DEBUG) console.log(...args);
4-
}
2+
const log = typeof process !== 'undefined' && process.env.DRAGGABLE_DEBUG ? console.log.bind(console) : function noop(): void {};
3+
export default log;

0 commit comments

Comments
 (0)