MCPcopy Create free account
hub / github.com/decaporg/decap-cms / findJsFiles

Function findJsFiles

scripts/test-package-integrity.mjs:40–54  ·  view source on GitHub ↗

* Recursively find all JS/MJS files in a directory

(dir, files = [])

Source from the content-addressed store, hash-verified

38 * Recursively find all JS/MJS files in a directory
39 */
40function findJsFiles(dir, files = []) {
41 if (!existsSync(dir)) return files;
42
43 const entries = readdirSync(dir);
44 for (const entry of entries) {
45 const fullPath = join(dir, entry);
46 const stat = statSync(fullPath);
47 if (stat.isDirectory()) {
48 findJsFiles(fullPath, files);
49 } else if (entry.endsWith('.js') || entry.endsWith('.mjs')) {
50 files.push(fullPath);
51 }
52 }
53 return files;
54}
55
56/**
57 * Check if the dist files contain browser-incompatible imports

Callers 1

checkDistForNodeProtocolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected