(dir, extensions)
| 50 | }; |
| 51 | |
| 52 | function walkFiles(dir, extensions) { |
| 53 | const out = []; |
| 54 | if (!fs.existsSync(dir)) return out; |
| 55 | for (const entry of fs.readdirSync(dir, { withFileTypes: true })) { |
| 56 | const full = path.join(dir, entry.name); |
| 57 | if (entry.isDirectory()) out.push(...walkFiles(full, extensions)); |
| 58 | else if (entry.isFile() && extensions.some((ext) => entry.name.endsWith(ext))) { |
| 59 | out.push(full); |
| 60 | } |
| 61 | } |
| 62 | return out; |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Walk an arbitrary JSON-shaped value and yield every nested `pagination` |
no outgoing calls
no test coverage detected