(source: string | undefined)
| 593 | } |
| 594 | |
| 595 | function typeAliasBody(source: string | undefined) { |
| 596 | const declaration = source?.match(/```ts\ntype \w+/) |
| 597 | if (!source || !declaration) { |
| 598 | return undefined |
| 599 | } |
| 600 | let index = declaration.index! + declaration[0].length |
| 601 | if (source[index] === '<') { |
| 602 | let depth = 0 |
| 603 | for (; index < source.length; index++) { |
| 604 | if (source[index] === '<') { |
| 605 | depth++ |
| 606 | } else if ( |
| 607 | source[index] === '>' && |
| 608 | source[index - 1] !== '=' && |
| 609 | --depth === 0 |
| 610 | ) { |
| 611 | index++ |
| 612 | break |
| 613 | } |
| 614 | } |
| 615 | } |
| 616 | return source.slice(index).match(/^ = ([\s\S]*?);\n```/)?.[1] |
| 617 | } |
| 618 | |
| 619 | function readPage(outputDir: string, from: string) { |
| 620 | return readFile(resolve(outputDir, `${from}.md`), 'utf8').then( |
no outgoing calls
no test coverage detected