From 306ebf7d6cb836783cc7b32a9cf938b9473886e7 Mon Sep 17 00:00:00 2001 From: Tony133 Date: Sun, 28 Feb 2021 16:51:04 +0100 Subject: [PATCH] chore(typeorm-utils): improvement --- lib/common/typeorm.utils.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/common/typeorm.utils.ts b/lib/common/typeorm.utils.ts index 8725627f2..aaaa998c6 100644 --- a/lib/common/typeorm.utils.ts +++ b/lib/common/typeorm.utils.ts @@ -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'; @@ -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);