MCPcopy Create free account
hub / github.com/itwanger/toBeBetterJavaer / walk

Function walk

docs/scripts/gen-paicoding-canonical.mjs:25–34  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

23const TIMEOUT_MS = 15000;
24
25function walk(dir) {
26 const out = [];
27 if (!existsSync(dir)) return out;
28 for (const name of readdirSync(dir)) {
29 const p = join(dir, name);
30 if (statSync(p).isDirectory()) out.push(...walk(p));
31 else if (name.endsWith(".md") && !/^(README|index)\.md$/i.test(name)) out.push(p);
32 }
33 return out;
34}
35
36async function probe(slug) {
37 const ctrl = new AbortController();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected