Skip to content

Commit

Permalink
fix: updated isNode check (protobufjs#1221) (protobufjs#1363)
Browse files Browse the repository at this point in the history
* Fixes protobufjs#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 <fenster@google.com>
  • Loading branch information
diegoblattner and alexander-fenster authored May 29, 2020
1 parent 192f5f1 commit 5564e7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/minimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5564e7b

Please sign in to comment.