"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EnvUtil = void 0;
var fs_1 = require("fs");
var EnvUtil = (function () {
    function EnvUtil() {
    }
    EnvUtil.prototype.getEnv = function (name) {
        if (name && name.toString() !== 'undefined' && name.toString() !== 'null') {
            var isFile = void 0;
            try {
                var fileStats = fs_1.statSync(name);
                isFile = fileStats.isFile();
            }
            catch (_) {
                isFile = false;
            }
            if ((name === null || name === void 0 ? void 0 : name.startsWith('/')) === true && isFile === true) {
                try {
                    var value = fs_1.readFileSync(name, { encoding: 'utf8' });
                    return value.trim();
                }
                catch (_) {
                    return name;
                }
            }
            else {
                return name;
            }
        }
        else {
            return undefined;
        }
    };
    return EnvUtil;
}());
exports.EnvUtil = EnvUtil;
