confmgr
Version:
Env. Configuration Manager
38 lines • 1.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SpecsFactory = void 0;
/**
* The SpecsFactory class is used under the hood when loading your YAML specs.
*
* This class is also accessible if you want to build your specs from code.
*/
var SpecsFactory = /** @class */ (function () {
function SpecsFactory(container) {
this.specs = {
config: {},
container: container,
};
}
SpecsFactory.prototype.getSpec = function (name, description, options) {
var res = {
name: name,
description: description,
options: options,
};
return res;
};
SpecsFactory.prototype.getSpecs = function () {
return this.specs;
};
SpecsFactory.prototype.appendSpec = function (module, newSpec) {
if (!this.specs.config)
this.specs.config = {};
if (!this.specs.config[module])
this.specs.config[module] = {};
this.specs.config[module][newSpec.name] = newSpec;
return this.specs;
};
return SpecsFactory;
}());
exports.SpecsFactory = SpecsFactory;
//# sourceMappingURL=SpecsFactory.js.map