Skip to content

Commit

Permalink
fix: only assign parents not exported from same file
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jul 20, 2021
1 parent c5e7c4f commit 4c2945d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions misc/structured-types/src/ts-walk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ export const anaylizeFiles = (
}
}
}
if (Object.keys(parser.parents).length) {
parsed.__parents = parser.parents;
// only return parents that are not already exported from the same file
const parents = Object.keys(parser.parents)
.filter(name => parsed[name] === undefined)
.reduce((acc, name) => ({ ...acc, [name]: parser.parents[name] }), {});
if (Object.keys(parents).length) {
parsed.__parents = parents;
}
if (collectDiagnostics) {
const allDiagnostics = ts
Expand Down

0 comments on commit 4c2945d

Please sign in to comment.