MCPcopy
hub / github.com/simstudioai/sim / collectFiles

Function collectFiles

apps/sim/app/seo.test.ts:43–56  ·  view source on GitHub ↗
(dir: string, exts: string[])

Source from the content-addressed store, hash-verified

41]
42
43function collectFiles(dir: string, exts: string[]): string[] {
44 const results: string[] = []
45 if (!fs.existsSync(dir)) return results
46
47 for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
48 const full = path.join(dir, entry.name)
49 if (entry.isDirectory()) {
50 results.push(...collectFiles(full, exts))
51 } else if (exts.some((ext) => entry.name.endsWith(ext)) && !entry.name.includes('.test.')) {
52 results.push(full)
53 }
54 }
55 return results
56}
57
58function getAllSeoFiles(exts: string[]): string[] {
59 const files: string[] = []

Callers 1

getAllSeoFilesFunction · 0.85

Calls 2

joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected