From a746d52cf2eecb63df3025f2f469b2e06cf70196 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Thu, 10 Nov 2016 09:59:27 -0800 Subject: [PATCH] don't create an empty object when no `process` This is also more readable in my opinion. --- browser.js | 2 +- index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/browser.js b/browser.js index 095a0451..26070efe 100644 --- a/browser.js +++ b/browser.js @@ -144,7 +144,7 @@ function load() { } catch(e) {} // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if ('env' in (typeof process === 'undefined' ? {} : process)) { + if (typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } diff --git a/index.js b/index.js index 8a39392c..e12cf4d5 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ * treat as a browser. */ -if ((typeof process === 'undefined' ? {} : process).type === 'renderer') { +if (typeof process !== 'undefined' && process.type === 'renderer') { module.exports = require('./browser.js'); } else { module.exports = require('./node.js');