Fakultas Ilmu Komputer UI

getEnv.ts 278 Bytes
Newer Older
Ahmad Izzudin Alifyandra's avatar
Ahmad Izzudin Alifyandra committed
1
2
3
4
5
6
7
8
9
10
11
import Constants from "expo-constants";

export const getEnv = (): "dev" | "stg" | "prod" => {
  const env: string = Constants.manifest.extra?.env || process.env.env;

  if (env === "dev" || env === "stg" || env === "prod") {
    return env;
  } else {
    return "dev";
  }
};