container.ts
Version:
Modular application framework
29 lines • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/** Environment variables class. */
var Environment = /** @class */ (function () {
function Environment() {
var variables = [];
for (var _i = 0; _i < arguments.length; _i++) {
variables[_i] = arguments[_i];
}
this.variables = Object.assign.apply(Object, [{}].concat(variables));
}
/** Returns a copy of environment. */
Environment.prototype.copy = function (variables) {
if (variables === void 0) { variables = {}; }
return new Environment(Object.assign({}, this.variables, variables));
};
/** Get an environment variable value or undefined. */
Environment.prototype.get = function (name) {
return this.variables[name];
};
/** Set an environment variable value. */
Environment.prototype.set = function (name, value) {
this.variables[name] = value;
return this;
};
return Environment;
}());
exports.Environment = Environment;
//# sourceMappingURL=Environment.js.map