Skip to content

Commit a746d52

Browse files
committed
don't create an empty object when no process
This is also more readable in my opinion.
1 parent 1c6f458 commit a746d52

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

browser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ function load() {
144144
} catch(e) {}
145145

146146
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
147-
if ('env' in (typeof process === 'undefined' ? {} : process)) {
147+
if (typeof process !== 'undefined' && 'env' in process) {
148148
r = process.env.DEBUG;
149149
}
150150

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* treat as a browser.
44
*/
55

6-
if ((typeof process === 'undefined' ? {} : process).type === 'renderer') {
6+
if (typeof process !== 'undefined' && process.type === 'renderer') {
77
module.exports = require('./browser.js');
88
} else {
99
module.exports = require('./node.js');

0 commit comments

Comments
 (0)