Skip to content

Commit

Permalink
feat(alias-import):Pr refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: Jaskeerat Singh Saluja <[email protected]>
  • Loading branch information
Jaskeerat Singh Saluja authored and Jaskeerat Singh Saluja committed Sep 6, 2024
1 parent 4334ac1 commit 782cff8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/codegen/fromcto/typescript/typescriptvisitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ class TypescriptVisitor {
// as well as all the super types) for all the classes in this model file
parameters.fileWriter.writeLine(0, '\n// imports');
const aliasedTypesMap = new Map();
modelFile.imports
.filter(imp => imp.$class === '[email protected]' && imp.aliasedTypes)
.forEach(imp => {
modelFile.imports.forEach((imp) => {
if (imp.$class === '[email protected]' && imp.aliasedTypes) {
imp.aliasedTypes.forEach(type => {
aliasedTypesMap.set(`${imp.namespace}.I${type.name}`, `I${type.aliasedName}`);
});
});
}
});

const properties = new Map();
modelFile.getAllDeclarations()
.filter(declaration => !declaration.isScalarDeclaration?.())
Expand Down Expand Up @@ -163,7 +164,6 @@ class TypescriptVisitor {
}
});


parameters.fileWriter.writeLine(0, '\n// interfaces');
parameters.aliasedTypesMap = aliasedTypesMap;
modelFile.getAllDeclarations()
Expand Down

0 comments on commit 782cff8

Please sign in to comment.