@studyportals/sp-r2d2
Version:
A framework that contains various components used when developing projects that will be deployed via AWS λ.
27 lines • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EnvironmentVariablesCatalog = void 0;
/**
* An implementation of the IEnvironmentVariablesProvider interface that can provide the value of
* previously configured variables.
*/
class EnvironmentVariablesCatalog {
get variableNamesToValueMap() {
return this._variableNamesToValueMap;
}
constructor() {
this.__i_environment_variables_provider__ = true;
this._variableNamesToValueMap = new Map();
}
get(variableName) {
if (false === this.variableNamesToValueMap.has(variableName)) {
throw new Error(`The ${variableName} variable has not been set.`);
}
return this.variableNamesToValueMap.get(variableName);
}
set(variableName, variableValue) {
this.variableNamesToValueMap.set(variableName, variableValue);
}
}
exports.EnvironmentVariablesCatalog = EnvironmentVariablesCatalog;
//# sourceMappingURL=environment-variables-catalog.class.js.map