MCPcopy
hub / github.com/byoungd/up / walk

Function walk

scripts/check-content.mjs:26–35  ·  view source on GitHub ↗

递归收集指定扩展名的文件。

(dir, exts, out = [])

Source from the content-addressed store, hash-verified

24
25/** 递归收集指定扩展名的文件。 */
26function 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
37const isExternal = (t) => /^(https?:|mailto:|tel:|data:|\/\/)/i.test(t);
38

Callers 2

checkStaleStringsFunction · 0.85
check-content.mjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected