diff --git a/src/util.js b/src/util.js index 29407f27..a510bc39 100644 --- a/src/util.js +++ b/src/util.js @@ -26,7 +26,12 @@ import * as stream from '@openpgp/web-stream-tools'; import { getBigInteger } from './biginteger'; -const debugMode = globalThis.process && globalThis.process.env.NODE_ENV === 'development'; +const debugMode = (() => { + try { + return process.env.NODE_ENV === 'development'; // eslint-disable-line no-process-env + } catch (e) {} + return false; +})(); const util = { isString: function(data) {