MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / findExamples

Function findExamples

tools/test-examples/index.js:182–198  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

180}
181
182function findExamples(dir) {
183 let results = [];
184 const entries = fs.readdirSync(dir, { withFileTypes: true });
185 for (const entry of entries) {
186 if (entry.name.startsWith('.')) continue;
187 const fullPath = path.join(dir, entry.name);
188 if (entry.isDirectory()) {
189 const manifestPath = path.join(fullPath, 'manifest.json');
190 if (fs.existsSync(manifestPath)) {
191 results.push(fullPath);
192 } else {
193 results = results.concat(findExamples(fullPath));
194 }
195 }
196 }
197 return results;
198}
199
200function needsNetwork(manifestPath) {
201 try {

Callers 1

mainFunction · 0.85

Calls 3

concatMethod · 0.65
isDirectoryMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected