MCPcopy
hub / github.com/vercel/next.js / collectDocFiles

Function collectDocFiles

packages/next-codemod/lib/agents-md.ts:159–170  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

157}
158
159export function collectDocFiles(dir: string): { relativePath: string }[] {
160 return (fs.readdirSync(dir, { recursive: true }) as string[])
161 .filter(
162 (f) =>
163 (f.endsWith('.mdx') || f.endsWith('.md')) &&
164 !/[/\\]index\.mdx$/.test(f) &&
165 !/[/\\]index\.md$/.test(f) &&
166 !f.startsWith('index.')
167 )
168 .sort()
169 .map((f) => ({ relativePath: f.replace(/\\/g, '/') }))
170}
171
172interface DocSection {
173 name: string

Callers 1

runAgentsMdFunction · 0.90

Calls 7

startsWithMethod · 0.80
testMethod · 0.65
replaceMethod · 0.65
mapMethod · 0.45
sortMethod · 0.45
filterMethod · 0.45
endsWithMethod · 0.45

Tested by

no test coverage detected