From 5564e7b5f07d3eab99762528e8ce88507af5a5a3 Mon Sep 17 00:00:00 2001 From: diegoblattner <15245871+diegoblattner@users.noreply.github.com> Date: Fri, 29 May 2020 23:36:10 +0100 Subject: [PATCH] fix: updated isNode check (#1221) (#1363) * Fixes https://github.com/protobufjs/protobuf.js/issues/1221 when used within SSR. `process` is a global variable since node [0.1.7](https://nodejs.org/api/globals.html#globals_process) and versions since [0.2.0](https://nodejs.org/api/process.html#process_process_versions). Co-authored-by: Alexander Fenster --- src/util/minimal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/minimal.js b/src/util/minimal.js index cc4ae5115..41f327c2f 100644 --- a/src/util/minimal.js +++ b/src/util/minimal.js @@ -52,7 +52,7 @@ util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next * * @type {boolean} * @const */ -util.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node); +util.isNode = Boolean(process && process.versions && process.versions.node); /** * Tests if the specified value is an integer.