(dir)
| 32 | const IMAGE_PATTERN = /\/images\/(walkthrough|concepts)\//; |
| 33 | |
| 34 | function findMdxFiles(dir) { |
| 35 | const results = []; |
| 36 | for (const entry of fs.readdirSync(dir, { withFileTypes: true })) { |
| 37 | const fullPath = path.join(dir, entry.name); |
| 38 | if (entry.isDirectory()) { |
| 39 | results.push(...findMdxFiles(fullPath)); |
| 40 | } else if (entry.name.endsWith('.mdx') || entry.name.endsWith('.md')) { |
| 41 | results.push(fullPath); |
| 42 | } |
| 43 | } |
| 44 | return results; |
| 45 | } |
| 46 | |
| 47 | function parseFrontmatter(content) { |
| 48 | const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/); |
no outgoing calls
no test coverage detected