rage-framework
Version:
## How to Install *server-side* ```bash npm install @rage-framework/server ```
28 lines • 1.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GenericConstruct = void 0;
const container_1 = require("../container");
const logger_service_1 = require("../services/utils/logger.service");
const module_service_1 = require("../services/core/module.service");
const moduleService = container_1.Container.get(module_service_1.ModuleService);
const bootstrapLogger = container_1.Container.get(logger_service_1.LoggerService);
function GenericConstruct(module, original, currentModule) {
return function construct(constructor, args) {
if (!module) {
return new constructor();
}
if (module.modules) {
moduleService.setImports(module.modules, original);
}
if (module.services) {
moduleService.setServices(module.services, original, currentModule);
}
if (module.behaviors) {
moduleService.setBehaviors(module.behaviors, original, currentModule);
}
bootstrapLogger.log(`Bootstrap -> @Module('${constructor.originalName}'): finished!`);
return container_1.Container.get(constructor);
};
}
exports.GenericConstruct = GenericConstruct;
//# sourceMappingURL=generic-constructor.js.map