(dirPath: string)
| 112 | } |
| 113 | |
| 114 | private async findMdxFiles(dirPath: string): Promise<string[]> { |
| 115 | const files: string[] = [] |
| 116 | |
| 117 | const entries = await fs.readdir(dirPath, { withFileTypes: true }) |
| 118 | |
| 119 | for (const entry of entries) { |
| 120 | const fullPath = path.join(dirPath, entry.name) |
| 121 | |
| 122 | if (entry.isDirectory()) { |
| 123 | const subFiles = await this.findMdxFiles(fullPath) |
| 124 | files.push(...subFiles) |
| 125 | } else if (entry.isFile() && entry.name.endsWith('.mdx')) { |
| 126 | files.push(fullPath) |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | return files |
| 131 | } |
| 132 | |
| 133 | private extractHeaders(content: string): HeaderInfo[] { |
| 134 | const headers: HeaderInfo[] = [] |
no test coverage detected