"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isProd = exports.isDev = exports.isProdEnv = exports.isDevEnv = exports.setCwd = exports.setTimezone = exports.setEnvironment = void 0;
const error_1 = require("./error");
function setEnvironment(env) {
    switch (env) {
        case 'dev':
        case 'development':
            env = 'development';
            break;
        case 'prod':
        case 'production':
            env = 'production';
            break;
        case 'test':
            env = 'test';
            break;
        default:
            throw new error_1.UnknownEnvironmentError(env, ['dev', 'prod', 'development', 'production', 'test']);
    }
    process.env['NODE_ENV'] = env;
    return env;
}
exports.setEnvironment = setEnvironment;
function setTimezone(tz) {
    process.env['TZ'] = tz;
}
exports.setTimezone = setTimezone;
function setCwd(path) {
    process.chdir(path);
}
exports.setCwd = setCwd;
function isDevEnv(env) {
    return env === 'development';
}
exports.isDevEnv = isDevEnv;
function isProdEnv(env) {
    return env === 'production';
}
exports.isProdEnv = isProdEnv;
/**isProd
 *
 * @deprecated
 *
 * @param env
 * @returns
 */
exports.isDev = isDevEnv;
/**
 *
 * @deprecated
 *
 * @param env
 * @returns
 */
exports.isProd = isProdEnv;
