Skip to content

Commit

Permalink
fix: fix util.global (#1441)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO authored Jul 13, 2020
1 parent f2faa8c commit 742b8dc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/util/minimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ util.pool = require("@protobufjs/pool");
util.LongBits = require("./longbits");

// global object reference
util.global = typeof window !== "undefined" && window
|| typeof global !== "undefined" && global
util.global = typeof global !== "undefined" && Object.prototype.toString.call(global) === "[object global]" && global
|| typeof window !== "undefined" && window
|| typeof self !== "undefined" && self
|| this; // eslint-disable-line no-invalid-this

Expand All @@ -52,9 +52,7 @@ util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next *
* @type {boolean}
* @const
*/
util.isNode = Boolean(typeof process !== "undefined" && process &&
typeof process.versions !== "undefined" && process.versions &&
process.versions.node);
util.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);

/**
* Tests if the specified value is an integer.
Expand Down

0 comments on commit 742b8dc

Please sign in to comment.