MCPcopy
hub / github.com/intentui/intentui / listFiles

Function listFiles

src/scripts/generate-registry.ts:147–161  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

145const escapeRegExp = (s: string) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
146
147const listFiles = async (dir: string) => {
148 const out: string[] = []
149 const stack = [dir]
150 while (stack.length) {
151 const d = stack.pop()!
152 if (!(await exists(d))) continue
153 const entries = await fs.readdir(d, { withFileTypes: true })
154 for (const e of entries) {
155 const full = path.join(d, e.name)
156 if (e.isDirectory()) stack.push(full)
157 else if (/\.(tsx|ts)$/.test(e.name) && !e.name.endsWith('.d.ts')) out.push(full)
158 }
159 }
160 return out
161}
162
163const importSpecifiers = (code: string) => {
164 const re =

Callers 1

buildAllFunction · 0.85

Calls 1

existsFunction · 0.85

Tested by

no test coverage detected