"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Value = void 0;
var CmUtils_1 = require("../utils/CmUtils");
function Value(key) {
    return function (target, attr) {
        Reflect.defineProperty(target, attr, {
            configurable: true,
            enumerable: true,
            get: function () {
                if (CmUtils_1.CmUtils.isEmpty(key)) {
                    return undefined;
                }
                else {
                    var value = process.env[key];
                    if (CmUtils_1.CmUtils.isNotEmpty(value)) {
                        return value;
                    }
                    else if (key.indexOf(":") > -1) {
                        return CmUtils_1.CmUtils.substringAfterLast(":", key);
                    }
                    else {
                        return value;
                    }
                }
            },
            set: function () { }
        });
    };
}
exports.Value = Value;
