confn
Version:
A simple to implement config management node js library. Setup dev, staging, production, etc. config for your node app effortlessly.
32 lines (31 loc) • 752 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class Mode {
constructor() {
this.modes = ['defaults', 'development', 'staging', 'production'];
}
addMode(mode) {
if (this.modes.includes(mode))
return false;
this.modes.push(mode);
return true;
}
getModes() {
return this.modes;
}
removeMode(mode) {
let modeFound = false;
const tempModes = [];
this.modes.forEach((m) => {
if (m === mode) {
modeFound = true;
}
else {
tempModes.push(m);
}
});
this.modes = tempModes;
return modeFound;
}
}
exports.default = Mode;