Skip to content
Permalink
Browse files
fix: fix util.global (#1441)
  • Loading branch information
dcodeIO committed Jul 13, 2020
1 parent f2faa8c commit 742b8dcbc750f9c2659088cbd88ea61fd11b24a7
Showing with 3 additions and 5 deletions.
  1. +3 −5 src/util/minimal.js
@@ -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

@@ -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.

0 comments on commit 742b8dc

Please sign in to comment.