Skip to content

Commit 56a431c

Browse files
committed
Improved browser/node detection
1 parent afac9f8 commit 56a431c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ module.exports.linebrk = function (str, maxLen) {
2222
};
2323

2424
module.exports.detectEnvironment = function () {
25-
if (process && process.title === 'browser' || (typeof(window) !== 'undefined' && window)) {
25+
26+
if (typeof(window) !== 'undefined' && window && !(process && process.title === 'node')) {
2627
return 'browser';
2728
}
2829

0 commit comments

Comments
 (0)