MCPcopy Create free account
hub / github.com/openai/plugins / visit

Function visit

plugins/plugin-eval/src/lib/files.js:133–151  ·  view source on GitHub ↗
(currentPath, depth = 0)

Source from the content-addressed store, hash-verified

131 const excluded = new Set([...IGNORED_DIRS, ...excludeDirs]);
132
133 async function visit(currentPath, depth = 0) {
134 const entries = await fs.readdir(currentPath, { withFileTypes: true });
135 for (const entry of entries) {
136 const entryPath = path.join(currentPath, entry.name);
137 if (entry.isDirectory()) {
138 if (excluded.has(entry.name)) {
139 continue;
140 }
141 if (depth === 0 && skipTopLevel.includes(entry.name)) {
142 continue;
143 }
144 await visit(entryPath, depth + 1);
145 continue;
146 }
147 if (entry.isFile()) {
148 files.push(entryPath);
149 }
150 }
151 }
152
153 await visit(rootPath);
154 return files.sort();

Callers 1

walkFilesFunction · 0.70

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected