diff --git a/lib/typeorm.providers.ts b/lib/typeorm.providers.ts index 6876bb02e..7f174ee78 100644 --- a/lib/typeorm.providers.ts +++ b/lib/typeorm.providers.ts @@ -10,8 +10,8 @@ export function createTypeOrmProviders( return (entities || []).map((entity) => ({ provide: getRepositoryToken(entity, dataSource), useFactory: (dataSource: DataSource) => { - const enitityMetadata = dataSource.entityMetadatas.find((meta) => meta.target === entity) - const isTreeEntity = typeof enitityMetadata?.treeType !== 'undefined' + const entityMetadata = dataSource.entityMetadatas.find((meta) => meta.target === entity) + const isTreeEntity = typeof entityMetadata?.treeType !== 'undefined' return isTreeEntity ? dataSource.getTreeRepository(entity) : dataSource.options.type === 'mongodb'