Skip to content

Commit 9aae77f

Browse files
author
Scott Thompson
authored
Allow function to be passed & executed if enabled
#370 (comment)
1 parent 3e1849d commit 9aae77f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/debug.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,6 @@ function enabled(name) {
221221

222222
function coerce(val) {
223223
if (val instanceof Error) return val.stack || val.message;
224+
if (typeof val === 'function') return val();
224225
return val;
225226
}

0 commit comments

Comments
 (0)