File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,10 @@ export class TypeOrmCoreModule implements OnApplicationShutdown {
217217 const dataSource = await createTypeormDataSource (
218218 options as DataSourceOptions ,
219219 ) ;
220- return dataSource . initialize && ! dataSource . isInitialized ? dataSource . initialize ( ) : dataSource ;
220+ // TODO: remove "dataSource.initialize" condition (left for backward compatibility)
221+ return ( dataSource as any ) . initialize && ! dataSource . isInitialized
222+ ? dataSource . initialize ( )
223+ : dataSource ;
221224 }
222225
223226 let entities = options . entities ;
@@ -233,7 +236,11 @@ export class TypeOrmCoreModule implements OnApplicationShutdown {
233236 ...options ,
234237 entities,
235238 } as DataSourceOptions ) ;
236- return dataSource . initialize && ! dataSource . isInitialized ? dataSource . initialize ( ) : dataSource ;
239+
240+ // TODO: remove "dataSource.initialize" condition (left for backward compatibility)
241+ return ( dataSource as any ) . initialize && ! dataSource . isInitialized
242+ ? dataSource . initialize ( )
243+ : dataSource ;
237244 } ) . pipe (
238245 handleRetry (
239246 options . retryAttempts ,
You can’t perform that action at this time.
0 commit comments