Skip to content

Commit

Permalink
fix(website): duplicate method in docs when interface merging (#10435)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qjuh committed Aug 19, 2024
1 parent bb71dc8 commit 8fb4008
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions packages/api-extractor/src/generators/ApiModelGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1788,18 +1788,20 @@ export class ApiModelGenerator {
{
kind: type?.includes("'") ? ExcerptTokenKind.Content : ExcerptTokenKind.Reference,
text: fixPrimitiveTypes(type ?? 'unknown', symbol),
canonicalReference: type?.includes("'")
? undefined
: DeclarationReference.package(pkg)
.addNavigationStep(
Navigation.Members as any,
DeclarationReference.parseComponent(type ?? 'unknown'),
)
.withMeaning(
(lookup[astSymbol?.astDeclarations.at(-1)?.declaration.kind ?? ts.SyntaxKind.ClassDeclaration] ??
'class') as Meaning,
)
.toString(),
canonicalReference:
type?.includes("'") || !astEntity
? undefined
: DeclarationReference.package(pkg)
.addNavigationStep(
Navigation.Members as any,
DeclarationReference.parseComponent(type ?? 'unknown'),
)
.withMeaning(
(lookup[
astSymbol?.astDeclarations.at(-1)?.declaration.kind ?? ts.SyntaxKind.ClassDeclaration
] ?? 'class') as Meaning,
)
.toString(),
},
{ kind: ExcerptTokenKind.Content, text: symbol ?? '' },
];
Expand Down Expand Up @@ -1867,7 +1869,7 @@ export class ApiModelGenerator {
: `${method.access ? `${method.access} ` : ''}${method.scope === 'static' ? 'static ' : ''}${method.name}(`
}${
method.params?.length
? `${method.params[0]!.name}${method.params[0]!.nullable || method.params[0]!.optional ? '?' : ''}`
? `${method.params[0]!.name}${method.params[0]!.nullable || method.params[0]!.optional ? '?' : ''}: `
: '): '
}`,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/src/generateSplitDocumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function resolveMembers<WantedItem extends ApiItem>(
.getMergedSiblings()
.filter((sibling) => sibling.containerKey !== parent.containerKey)
.flatMap((sibling) => (sibling as ApiItemContainerMixin).findMembersWithInheritance().items)
.filter((item) => predicate(item) && !seenItems.has(item.containerKey))
.filter((item) => predicate(item) && !seenItems.has(item.displayName))
.map((item) => ({
item: item as WantedItem,
inherited: item.parent ? (item.parent as ApiItemContainerMixin) : undefined,
Expand Down

0 comments on commit 8fb4008

Please sign in to comment.