MCPcopy Create free account
hub / github.com/middleapi/orpc / findReadmes

Function findReadmes

scripts/sync-sponsor.ts:27–49  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

25const SKIP_DIRS = new Set(['node_modules', '.git', 'dist', '.output', '.next', '.nuxt', '.turbo'])
26
27async function findReadmes(dir: string): Promise<string[]> {
28 const entries = await readdir(dir, { withFileTypes: true })
29 const result: string[] = []
30 const subdirPromises: Promise<string[]>[] = []
31
32 for (const entry of entries) {
33 const fullPath = path.join(dir, entry.name)
34
35 if (entry.isDirectory()) {
36 if (SKIP_DIRS.has(entry.name)) {
37 continue
38 }
39
40 subdirPromises.push(findReadmes(fullPath))
41 }
42 else if (entry.isFile() && entry.name === README_FILE_NAME) {
43 result.push(fullPath)
44 }
45 }
46
47 const subResults = await Promise.all(subdirPromises)
48 return result.concat(...subResults)
49}
50
51function withTracking(url: string): string {
52 try {

Callers 1

mainFunction · 0.85

Calls 2

pushMethod · 0.80
concatMethod · 0.80

Tested by

no test coverage detected