递归收集指定扩展名的文件。
(dir, exts, out = [])
| 24 | |
| 25 | /** 递归收集指定扩展名的文件。 */ |
| 26 | function walk(dir, exts, out = []) { |
| 27 | for (const name of readdirSync(dir)) { |
| 28 | if (IGNORE_DIRS.has(name)) continue; |
| 29 | const p = join(dir, name); |
| 30 | const s = statSync(p); |
| 31 | if (s.isDirectory()) walk(p, exts, out); |
| 32 | else if (exts.includes(extname(name))) out.push(p); |
| 33 | } |
| 34 | return out; |
| 35 | } |
| 36 | |
| 37 | const isExternal = (t) => /^(https?:|mailto:|tel:|data:|\/\/)/i.test(t); |
| 38 |
no outgoing calls
no test coverage detected