import minimist from 'minimist';

const enum Environment {
  DEV = 'dev',
  PROD = 'prod',
}

function getEnv(): Environment {
  switch (minimist(process.argv).env) {
    case 'd':
    case 'dev':
      return Environment.DEV;
    default:
      return Environment.PROD;
  }
}

export function isDev(): boolean {
  return getEnv() === Environment.DEV;
}
