(outputDir: string, from: string)
| 668 | // The page whose `## Properties` table describes the type: the type itself, or the interface every |
| 669 | // member of a union extends. |
| 670 | async function propertiesPage(outputDir: string, from: string) { |
| 671 | const pages = await resolveInterfacePages(outputDir, from) |
| 672 | if (!pages?.length) { |
| 673 | return undefined |
| 674 | } |
| 675 | if (pages.length === 1) { |
| 676 | return pages[0] |
| 677 | } |
| 678 | const bases = new Set<string>() |
| 679 | for (const page of pages) { |
| 680 | const base = (await readPage(outputDir, page))?.match( |
| 681 | /\n## Extends\n\n- \[`\w+`\]\((\w+)\.md\)[^\n]*\n\n##/, |
| 682 | )?.[1] |
| 683 | if (!base) { |
| 684 | return undefined |
| 685 | } |
| 686 | bases.add(`${dirname(page)}/${base}`) |
| 687 | } |
| 688 | return bases.size === 1 ? [...bases][0] : undefined |
| 689 | } |
| 690 | |
| 691 | async function readPropertiesTable(outputDir: string, from: string) { |
| 692 | const source = await readPage(outputDir, from) |
no test coverage detected