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

Function walkFiles

scripts/lint-pagination-invariant.cjs:52–63  ·  view source on GitHub ↗
(dir, extensions)

Source from the content-addressed store, hash-verified

50};
51
52function walkFiles(dir, extensions) {
53 const out = [];
54 if (!fs.existsSync(dir)) return out;
55 for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
56 const full = path.join(dir, entry.name);
57 if (entry.isDirectory()) out.push(...walkFiles(full, extensions));
58 else if (entry.isFile() && extensions.some((ext) => entry.name.endsWith(ext))) {
59 out.push(full);
60 }
61 }
62 return out;
63}
64
65/**
66 * Walk an arbitrary JSON-shaped value and yield every nested `pagination`

Callers 2

lintSchemasFunction · 0.85
lintStoryboardsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected