Skip to content

Commit

Permalink
feat(core): add em.repo() shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
B4nan committed Nov 1, 2022
1 parent 31d6d77 commit feebd7c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/core/src/EntityManager.ts
Expand Up @@ -84,6 +84,13 @@ export class EntityManager<D extends IDatabaseDriver = IDatabaseDriver> {
return this.repositoryMap[entityName] as unknown as GetRepository<T, U>;
}

/**
* Shortcut for `em.getRepository()`.
*/
repo<T extends object, U extends EntityRepository<T> = EntityRepository<T>>(entityName: EntityName<T>): GetRepository<T, U> {
return this.getRepository(entityName);
}

/**
* Gets EntityValidator instance
*/
Expand Down

0 comments on commit feebd7c

Please sign in to comment.