"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get getEnvOrDefault () {
        return getEnvOrDefault;
    },
    get isDevelopmentEnvironment () {
        return isDevelopmentEnvironment;
    },
    get isNode () {
        return isNode;
    },
    get isProductionEnvironment () {
        return isProductionEnvironment;
    },
    get isTestEnvironment () {
        return isTestEnvironment;
    }
});
const _serverconstants = require("../server.constants");
const _dotenv = /*#__PURE__*/ _interop_require_default(require("dotenv"));
const _nodepath = require("node:path");
const _fsutils = require("./fs.utils");
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
if (process.env.NODE_ENV !== "test") {
    _dotenv.default.config({
        path: process.env.ENV_FILE || (0, _nodepath.join)((0, _fsutils.superRootPath)(), ".env")
    });
}
function getEnvOrDefault(key, defaultValue) {
    if (!Object.keys(process.env).includes(key) || !process.env[key]?.length) {
        return defaultValue;
    }
    return process.env[key];
}
function isDevelopmentEnvironment() {
    return process.env.NODE_ENV === _serverconstants.AppConstants.defaultDevelopmentEnv;
}
function isTestEnvironment() {
    return process.env.NODE_ENV === _serverconstants.AppConstants.defaultTestEnv;
}
function isProductionEnvironment() {
    return process.env.NODE_ENV === _serverconstants.AppConstants.defaultProductionEnv;
}
function isNode() {
    return "NODE" in process.env;
}

//# sourceMappingURL=env.utils.js.map