Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/tracking / src / googleAnalytics / helpers / getSystemType.js
Size: Mime:
const SystemTypes = {
  DEVELOPMENT: 'development',
  STAGING: 'staging',
  PREPRODUCTION: 'preproduction',
  PRODUCTION: 'production',
};

// keys are formed by NODE_ENV and DOODLE_ENV env vars
const envsToSystemType = {
  'production-staging': SystemTypes.STAGING,
  'production-preproduction': SystemTypes.PREPRODUCTION,
  'production-production': SystemTypes.PRODUCTION,
};

const getSystemType = ({ NODE_ENV, DOODLE_ENV }) => {
  const envsKey = `${NODE_ENV}-${DOODLE_ENV}`;

  return envsToSystemType[envsKey] || SystemTypes.DEVELOPMENT;
};

export { SystemTypes, getSystemType };