get-is-production-without-debug.js 933 B

12345678910111213141516171819202122232425
  1. /**
  2. * Module dependencies
  3. */
  4. // N/A
  5. /**
  6. * getIsProductionWithoutDebug()
  7. *
  8. * Make a guess (`isProduction`) as to whether or not we're dealing with a production environment.
  9. *
  10. * > Note that if this is being run from a browser environment, or if the DEBUG environment var is truthy,
  11. * > this always returns as `false`. (This is to allow for easier debugging in production environments.)
  12. *
  13. * @returns {Boolean}
  14. */
  15. module.exports = function getIsProductionWithoutDebug(){
  16. var _isDebugNodeEnv = typeof process !== 'undefined' && process.env.DEBUG;// eslint-disable-line no-undef
  17. var _isProductionNodeEnv = typeof process !== 'undefined' && process.env.NODE_ENV === 'production';// eslint-disable-line no-undef
  18. var _isProductionWindow = typeof window !== 'undefined' && window.environment === 'production';// eslint-disable-line no-undef
  19. return (_isProductionNodeEnv || _isProductionWindow) && !_isDebugNodeEnv;
  20. };