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 <[email protected]>
  • Loading branch information
2 people authored and Taylor McIntyre committed Oct 16, 2020
1 parent 938b920 commit 7d68cf6
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 7d68cf6

Please sign in to comment.