Skip to content

Commit

Permalink
fix: Avoid crash with removed project reflection
Browse files Browse the repository at this point in the history
Resolves #1489

That said, you really ought not do this... it is somewhat meaningless.
  • Loading branch information
Gerrit0 committed Jan 31, 2021
1 parent 3097c5a commit fa95b07
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/lib/converter/plugins/CommentPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Converter } from "../converter";
import { Context } from "../context";
import { partition, uniq } from "lodash";
import { SourceReference } from "../../models";
import { BindOption, removeIfPresent } from "../../utils";
import { BindOption, filterMap, removeIfPresent } from "../../utils";

/**
* These tags are not useful to display in the generated documentation.
Expand Down Expand Up @@ -219,14 +219,13 @@ export class CommentPlugin extends ConverterComponent {

// remove functions with empty signatures after their signatures have been removed
const [allRemoved, someRemoved] = partition(
hidden
.map((reflection) => reflection.parent!)
.filter((method) =>
method.kindOf(
ReflectionKind.FunctionOrMethod |
ReflectionKind.Constructor
)
) as DeclarationReflection[],
filterMap(hidden, (reflection) =>
reflection.parent?.kindOf(
ReflectionKind.FunctionOrMethod | ReflectionKind.Constructor
)
? reflection.parent
: void 0
) as DeclarationReflection[],
(method) => method.signatures?.length === 0
);
allRemoved.forEach((reflection) =>
Expand Down

0 comments on commit fa95b07

Please sign in to comment.