Jelajahi Sumber

debug.ts tweak

David Sehnal 4 tahun lalu
induk
melakukan
ffeeddb37a
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      src/mol-util/debug.ts

+ 2 - 2
src/mol-util/debug.ts

@@ -8,13 +8,13 @@
  * on node `process.env.NODE_ENV` is available, in webpack build it is automatically set
  * by the DefinePlugin to the webpack `mode` value
  */
-let isProductionMode = process.env.NODE_ENV === 'production';
+let isProductionMode = typeof process !== 'undefined' && process.env?.NODE_ENV === 'production';
 
 /**
  * set to true to enable more comprehensive checks and assertions,
  * mostly used in `mol-gl` and in valence-model calculation
  */
-let isDebugMode = process.env.DEBUG === '*' || process.env.DEBUG === 'molstar';
+let isDebugMode = typeof process !== 'undefined' && (process.env?.DEBUG === '*' || process.env?.DEBUG === 'molstar');
 
 export { isProductionMode, isDebugMode };