MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / listFilesRecursive

Function listFilesRecursive

docs/scripts/rewrite-doc-links.mjs:15–30  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

13const isDocFile = (p) => p.endsWith('.md') || p.endsWith('.mdx');
14
15async function listFilesRecursive(dir) {
16 const out = [];
17 async function walk(current) {
18 const entries = await fs.readdir(current, { withFileTypes: true });
19 for (const entry of entries) {
20 const full = path.join(current, entry.name);
21 if (entry.isDirectory()) {
22 await walk(full);
23 } else if (entry.isFile() && isDocFile(full)) {
24 out.push(full);
25 }
26 }
27 }
28 await walk(dir);
29 return out;
30}
31
32function parseFrontMatter(content) {
33 if (!content.startsWith('---\n')) return {};

Callers 1

mainFunction · 0.85

Calls 1

walkFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…