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 {
217
217
const dataSource = await createTypeormDataSource (
218
218
options as DataSourceOptions ,
219
219
) ;
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 ;
221
224
}
222
225
223
226
let entities = options . entities ;
@@ -233,7 +236,11 @@ export class TypeOrmCoreModule implements OnApplicationShutdown {
233
236
...options ,
234
237
entities,
235
238
} 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 ;
237
244
} ) . pipe (
238
245
handleRetry (
239
246
options . retryAttempts ,
You can’t perform that action at this time.
0 commit comments