From 153da09a384fdbf797b66e4500b69a72a7a47b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20My=C5=9Bliwiec?= Date: Tue, 14 Jun 2022 08:43:46 +0200 Subject: [PATCH] chore(): add todo comments --- lib/typeorm-core.module.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/typeorm-core.module.ts b/lib/typeorm-core.module.ts index 05095c1b4..e59d1966f 100644 --- a/lib/typeorm-core.module.ts +++ b/lib/typeorm-core.module.ts @@ -217,7 +217,10 @@ export class TypeOrmCoreModule implements OnApplicationShutdown { const dataSource = await createTypeormDataSource( options as DataSourceOptions, ); - return dataSource.initialize && !dataSource.isInitialized ? dataSource.initialize() : dataSource; + // TODO: remove "dataSource.initialize" condition (left for backward compatibility) + return (dataSource as any).initialize && !dataSource.isInitialized + ? dataSource.initialize() + : dataSource; } let entities = options.entities; @@ -233,7 +236,11 @@ export class TypeOrmCoreModule implements OnApplicationShutdown { ...options, entities, } as DataSourceOptions); - return dataSource.initialize && !dataSource.isInitialized ? dataSource.initialize() : dataSource; + + // TODO: remove "dataSource.initialize" condition (left for backward compatibility) + return (dataSource as any).initialize && !dataSource.isInitialized + ? dataSource.initialize() + : dataSource; }).pipe( handleRetry( options.retryAttempts,