(dirPath: string)
| 42 | } |
| 43 | |
| 44 | function readCompanionFiles(dirPath: string): Array<{ filename: string; content: string }> { |
| 45 | if (!fs.existsSync(dirPath)) return []; |
| 46 | |
| 47 | const out: Array<{ filename: string; content: string }> = []; |
| 48 | walkFiles(dirPath, dirPath, out); |
| 49 | return out.sort((left, right) => left.filename.localeCompare(right.filename)); |
| 50 | } |
| 51 | |
| 52 | function walkFiles(rootDir: string, currentDir: string, out: Array<{ filename: string; content: string }>): void { |
| 53 | for (const entry of fs.readdirSync(currentDir, { withFileTypes: true })) { |
no test coverage detected