Skip to content

Commit

Permalink
Merge pull request #811 from Tony133/chore/typeorm-utils-improvement
Browse files Browse the repository at this point in the history
chore(typeorm-utils): improvement
  • Loading branch information
kamilmysliwiec authored Mar 1, 2021
2 parents 4259aae + 306ebf7 commit e0f9067
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/common/typeorm.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
EntitySchema,
Repository,
} from 'typeorm';
import { isNullOrUndefined } from 'util';
import { v4 as uuid } from 'uuid';
import { CircularDependencyException } from '../exceptions/circular-dependency.exception';
import { EntityClassOrSchema } from '../interfaces/entity-class-or-schema.type';
Expand All @@ -27,7 +26,7 @@ export function getRepositoryToken(
entity: EntityClassOrSchema,
connection: Connection | ConnectionOptions | string = DEFAULT_CONNECTION_NAME,
) {
if (isNullOrUndefined(entity)) {
if ((entity === null) || (entity === undefined)) {
throw new CircularDependencyException('@InjectRepository()');
}
const connectionPrefix = getConnectionPrefix(connection);
Expand Down

0 comments on commit e0f9067

Please sign in to comment.