( outputDir: string, typeLines: Array<string>, )
| 428 | |
| 429 | // The property table for the first type line that has one. |
| 430 | async function findPropertiesTable( |
| 431 | outputDir: string, |
| 432 | typeLines: Array<string>, |
| 433 | ) { |
| 434 | for (const typeLine of typeLines) { |
| 435 | const link = await linkedTypePage(outputDir, typeLine) |
| 436 | const from = link && (await propertiesPage(outputDir, link)) |
| 437 | const table = from && (await readPropertiesTable(outputDir, from)) |
| 438 | if (table) { |
| 439 | return table |
| 440 | } |
| 441 | } |
| 442 | const bases = await findBasePages(outputDir, typeLines) |
| 443 | if (bases.length) { |
| 444 | return `Built from ${bases |
| 445 | .map( |
| 446 | (base) => `[\`${base.split('/').at(-1)}\`](../${base}.md#properties)`, |
| 447 | ) |
| 448 | .join(', ')}. See the type above for what it changes.` |
| 449 | } |
| 450 | return undefined |
| 451 | } |
| 452 | |
| 453 | // Splits a type expression at a top-level separator, outside `<>`, `()`, `{}`, and `[]`. |
| 454 | function splitTopLevel(type: string, separator: string) { |
no test coverage detected