Skip to content

Commit 19b210a

Browse files
author
Cache Hamm
committed
fix DEBUG=json-rules-engine in browsers
1 parent 2d6e834 commit 19b210a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/debug.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export default function debug (message) {
2-
if (typeof process !== 'undefined' && process.env && process.env.DEBUG && process.env.DEBUG.match(/json-rules-engine/)) {
2+
if ((typeof process !== 'undefined' && process.env && process.env.DEBUG && process.env.DEBUG.match(/json-rules-engine/)) ||
3+
(typeof window !== 'undefined' && window.localStorage && window.localStorage.debug && window.localStorage.debug.match(/json-rules-engine/))) {
34
console.log(message)
45
}
56
}

0 commit comments

Comments
 (0)