Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
get injector(): Injector {
if (typeof this._cache.injector === 'undefined') {
this.checkConfiguration();
const injector = (this._cache.injector = new Injector({
name: this.name,
injectorScope: ProviderScope.Application,
defaultProviderScope: this.selfDefaultProviderScope,
hooks: [
'onInit',
'onRequest',
'onResponse',
'onError',
'onConnect',
'onOperation',
'onOperationComplete',
'onDisconnect'
],
initialProviders: this.selfProviders,
children: this.selfImports.map(module => module.injector)
}));
this._cacheAsync.injectorAsync = new Promise(async (resolve, reject) => {
try {
this.checkConfiguration();
const [initialProviders, children] = await Promise.all([
Promise.resolve().then(() => this.selfProviders),
Promise.resolve().then(() => Promise.all(this.selfImports.map(module => module.injectorAsync)))
]);
const injector = (this._cache.injector = new Injector({
name: this.name,
injectorScope: ProviderScope.Application,
defaultProviderScope: this.selfDefaultProviderScope,
hooks: [
'onInit',
'onRequest',
'onResponse',
'onError',
'onConnect',
'onOperation',
'onOperationComplete',
'onDisconnect'
],
initialProviders,
children
}));