(sub)
| 83 | |
| 84 | const entries = []; |
| 85 | const walk = (sub) => { |
| 86 | let listing; |
| 87 | try { listing = fs.readdirSync(sub, { withFileTypes: true }); } |
| 88 | catch { return; } |
| 89 | for (const ent of listing) { |
| 90 | const full = path.join(sub, ent.name); |
| 91 | if (ent.isDirectory()) walk(full); |
| 92 | else if (ent.isFile() && /\.(md|txt)$/i.test(ent.name)) { |
| 93 | entries.push(this._parseEntry(full, dir)); |
| 94 | } |
| 95 | } |
| 96 | }; |
| 97 | walk(dir); |
| 98 | this._index = entries.filter(Boolean); |
| 99 | return this._index; |
no test coverage detected