@piggly/fastify-chassis
Version:
An ESM/CommonJS toolkit to help you to do common operations in your back-end applications with Fastify and NodeJS.
75 lines • 1.93 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EnvironmentService = void 0;
const ddd_toolkit_1 = require("@piggly/ddd-toolkit");
/**
* @file The environment settings service.
* @since 5.0.0
*/
class EnvironmentService {
/**
* The settings.
*
* @protected
* @memberof EnvironmentService
* @since 5.0.0
* @author Caique Araujo <caique@piggly.com.br>
*/
_settings;
/**
* Create a new environment settings service.
*
* @param settings The settings.
* @public
* @constructor
* @memberof EnvironmentService
* @since 5.0.0
* @author Caique Araujo <caique@piggly.com.br>
*/
constructor(settings) {
this._settings = settings;
}
/**
* Get the settings.
*
* @public
* @memberof EnvironmentService
* @since 5.0.0
* @author Caique Araujo <caique@piggly.com.br>
*/
get settings() {
return this._settings;
}
/**
* Register application service.
*
* @param {LoggerService} service
* @public
* @static
* @memberof LoggerService
* @since 5.0.0
* @author Caique Araujo <caique@piggly.com.br>
*/
static register(service) {
if (ddd_toolkit_1.ServiceProvider.has('EnvironmentService')) {
return;
}
ddd_toolkit_1.ServiceProvider.register('EnvironmentService', service);
}
/**
* Resolve application service.
*
* @returns {LoggerService}
* @throws {Error} If service is not registered.
* @public
* @static
* @memberof LoggerService
* @since 5.0.0
* @author Caique Araujo <caique@piggly.com.br>
*/
static resolve() {
return ddd_toolkit_1.ServiceProvider.resolve('EnvironmentService');
}
}
exports.EnvironmentService = EnvironmentService;
//# sourceMappingURL=EnvironmentService.js.map