Skip to content

Commit

Permalink
chore(): add todo comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Jun 14, 2022
1 parent 3a4c65c commit 153da09
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/typeorm-core.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit 153da09

Please sign in to comment.