UNPKG

@tsed/common

Version:
15 lines 533 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.callHook = void 0; const SKIP_HOOKS = ["$beforeInit", "$afterInit", "$onInit", "$onMountingMiddlewares"]; async function callHook(injector, rootModule, key, ...args) { injector.logger.info(`\x1B[1mCall hook ${key}\x1B[22m`); if (key in rootModule) { await rootModule[key](...args); } if (!SKIP_HOOKS.includes(key)) { await injector.emit(key); } } exports.callHook = callHook; //# sourceMappingURL=callHook.js.map