MCPcopy Index your code
hub / github.com/labring/FastGPT / getAllMdxFiles

Function getAllMdxFiles

document/script/checkDocRefs.js:41–51  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

39]);
40
41function getAllMdxFiles(dir) {
42 const out = [];
43 (function walk(p) {
44 for (const entry of fs.readdirSync(p, { withFileTypes: true })) {
45 const full = path.join(p, entry.name);
46 if (entry.isDirectory()) walk(full);
47 else if (MDX_EXTS.includes(path.extname(entry.name).toLowerCase())) out.push(full);
48 }
49 })(dir);
50 return out;
51}
52
53function fileExists(p) {
54 try {

Callers 1

mainFunction · 0.85

Calls 5

walkFunction · 0.85
extnameMethod · 0.80
joinMethod · 0.45
includesMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected