Skip to content

Commit

Permalink
fix(website): remove merged interface from sitemap (#10343)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qjuh authored Jun 9, 2024
1 parent 02d1964 commit c5d40d3
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions packages/scripts/src/generateSplitDocumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,12 @@ function itemExcerptText(excerpt: Excerpt, apiPackage: ApiPackage) {
// dapi-types doesn't have routes for class members
// so we can assume this member is for an enum
if (meaning === 'member' && path && 'parent' in path) {
href += `/enum/${path.parent}#${path.component}`;
// unless it's a variable like FormattingPatterns.Role
if (path.parent.toString() === '__type') {
href += `#${token.text.split('.')[0]}`;
} else {
href += `/enum/${path.parent}#${path.component}`;
}
} else if (meaning === 'type' || meaning === 'var') {
href += `#${token.text}`;
} else {
Expand Down Expand Up @@ -951,11 +956,16 @@ export async function generateSplitDocumentation({

const members = entry.members
.filter((item) => {
if (item.kind !== 'Function') {
return true;
switch (item.kind) {
case ApiItemKind.Function:
return (item as ApiFunction).overloadIndex === 1;
case ApiItemKind.Interface:
return !entry.members.some(
(innerItem) => innerItem.kind === ApiItemKind.Class && innerItem.displayName === item.displayName,
);
default:
return true;
}

return (item as ApiFunction).overloadIndex === 1;
})
.map((item) => ({
kind: item.kind,
Expand Down

0 comments on commit c5d40d3

Please sign in to comment.