From 56a431c3a2f9147c681f5f850fa50ad701382cb9 Mon Sep 17 00:00:00 2001 From: Ackermann Yuriy Date: Mon, 14 May 2018 15:25:36 +0300 Subject: [PATCH] Improved browser/node detection --- src/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index 81b1b22..64bc205 100644 --- a/src/utils.js +++ b/src/utils.js @@ -22,7 +22,8 @@ module.exports.linebrk = function (str, maxLen) { }; module.exports.detectEnvironment = function () { - if (process && process.title === 'browser' || (typeof(window) !== 'undefined' && window)) { + + if (typeof(window) !== 'undefined' && window && !(process && process.title === 'node')) { return 'browser'; }