From 45601e7c6b8f3e05176c7fa4eb6873f5cfc02026 Mon Sep 17 00:00:00 2001 From: diegoblattner <15245871+diegoblattner@users.noreply.github.com> Date: Thu, 20 Feb 2020 13:16:22 +0000 Subject: [PATCH] fix: updated isNode check (#1221) * 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). --- 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 48b62bf43..cdaeed1af 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.