13 lines
393 B
TypeScript
13 lines
393 B
TypeScript
import type { Environment } from "@/types/environment";
|
|
|
|
export const defineEnvironment = (): Environment => {
|
|
const environments: Environment[] = ["development", "staging", "production"];
|
|
const environment = process.env.ENVIRONMENT as Environment | undefined;
|
|
|
|
if (environment && environments.includes(environment)) {
|
|
return environment;
|
|
}
|
|
|
|
return "development";
|
|
};
|