MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / findMdxFiles

Function findMdxFiles

scripts/check-seo-metadata.cjs:34–45  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

32const IMAGE_PATTERN = /\/images\/(walkthrough|concepts)\//;
33
34function findMdxFiles(dir) {
35 const results = [];
36 for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
37 const fullPath = path.join(dir, entry.name);
38 if (entry.isDirectory()) {
39 results.push(...findMdxFiles(fullPath));
40 } else if (entry.name.endsWith('.mdx') || entry.name.endsWith('.md')) {
41 results.push(fullPath);
42 }
43 }
44 return results;
45}
46
47function parseFrontmatter(content) {
48 const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected