From 314c0675f119b16f27584ee6e53f81a5eb9910d0 Mon Sep 17 00:00:00 2001 From: Kononnable Date: Sun, 10 Nov 2019 18:48:38 +0100 Subject: [PATCH] fix removal of unused typeorm imports --- src/ModelGeneration.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ModelGeneration.ts b/src/ModelGeneration.ts index 143fd30..fe27e46 100644 --- a/src/ModelGeneration.ts +++ b/src/ModelGeneration.ts @@ -73,7 +73,7 @@ function removeUnusedImports(rendered: string) { .split(","); const restOfEntityDefinition = rendered.substring(closeBracketIndex); const distinctImports = imports.filter( - v => restOfEntityDefinition.indexOf(v) !== -1 + v => restOfEntityDefinition.indexOf(`@${v}(`) !== -1 ); return `${rendered.substring(0, openBracketIndex)}${distinctImports.join( ","