(dir, exts)
| 20 | const REFERENCE_EXTS = [".astro", ".mdx", ".md", ".ts", ".tsx", ".mjs"]; |
| 21 | |
| 22 | function walk(dir, exts) { |
| 23 | const out = []; |
| 24 | |
| 25 | for (const entry of readdirSync(dir)) { |
| 26 | const full = join(dir, entry); |
| 27 | |
| 28 | if (statSync(full).isDirectory()) { |
| 29 | out.push(...walk(full, exts)); |
| 30 | continue; |
| 31 | } |
| 32 | |
| 33 | if (exts.some((ext) => full.endsWith(ext))) { |
| 34 | out.push(full); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | return out; |
| 39 | } |
| 40 | |
| 41 | const componentFiles = walk(COMPONENTS_DIR, [".tsx"]); |
| 42 | const sources = walk(SRC, REFERENCE_EXTS).map((file) => ({ |
no outgoing calls
no test coverage detected