nestjs-resilience
Version:
A module for improving the reliability and fault-tolerance of your NestJS applications
28 lines (27 loc) • 727 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.Strategy = void 0;
const common_1 = require("@nestjs/common");
class Strategy {
constructor(options) {
this.options = options;
this.name = this.constructor.name;
this.logger = new common_1.Logger(this.constructor.name);
}
setOptions(options) {
this.options = options;
}
updateOption(key, value) {
this.options[key] = value;
}
updateOptions(options) {
this.options = Object.assign(this.options, options);
}
getOptions() {
return this.options;
}
clone() {
return new this.constructor(this.options);
}
}
exports.Strategy = Strategy;
;