Преглед на файлове

chore: Fix docgen path handling

Michael Bromley преди 2 години
родител
ревизия
73fce94bf1
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      scripts/docs/typescript-docs-parser.ts

+ 2 - 1
scripts/docs/typescript-docs-parser.ts

@@ -55,7 +55,8 @@ export class TypescriptDocsParser {
                     existingPage.declarations.push(declaration);
                 } else {
                     const normalizedTitle = this.kebabCase(pageTitle);
-                    const fileName = normalizedTitle === declaration.category ? '_index' : normalizedTitle;
+                    const categoryLastPart = declaration.category.split('/').pop();
+                    const fileName = normalizedTitle === categoryLastPart ? '_index' : normalizedTitle;
                     pages.set(pageTitle, {
                         title: pageTitle,
                         category: declaration.category.split('/'),