fix removal of unused typeorm imports

This commit is contained in:
Kononnable 2019-11-10 18:48:38 +01:00
parent f346c0b904
commit 314c0675f1

View File

@ -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(
","