Skip to content

Commit

Permalink
Remove reflection update (#897)
Browse files Browse the repository at this point in the history
Keep CommentPlugin.removeReflection compatible.
  • Loading branch information
jonchardy authored and Gerrit0 committed Nov 6, 2018
1 parent c1dda6b commit 6d5b21b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/lib/converter/plugins/CommentPlugin.ts
Expand Up @@ -331,7 +331,7 @@ export class CommentPlugin extends ConverterComponent {
/**
* Remove the given reflection from the project.
*/
private static removeReflection(project: ProjectReflection, reflection: Reflection, deletedIds: number[]) {
static removeReflection(project: ProjectReflection, reflection: Reflection, deletedIds?: number[]) {
reflection.traverse((child) => CommentPlugin.removeReflection(project, child, deletedIds));

const parent = <DeclarationReflection> reflection.parent;
Expand Down Expand Up @@ -389,7 +389,16 @@ export class CommentPlugin extends ConverterComponent {
let id = reflection.id;
delete project.reflections[id];

// keep track of the reflections that have been deleted
deletedIds.push(id);
// if an array was provided, keep track of the reflections that have been deleted, otherwise clean symbol mappings
if (deletedIds) {
deletedIds.push(id);
} else {
for (let key in project.symbolMapping) {
if (project.symbolMapping.hasOwnProperty(key) && project.symbolMapping[key] === id) {
delete project.symbolMapping[key];
}
}
}

}
}

0 comments on commit 6d5b21b

Please sign in to comment.