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

Function findJsFiles

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

* Recursively find all JS/MJS files in a directory

(dir, files = [])

Source from the content-addressed store, hash-verified

118 * Recursively find all JS/MJS files in a directory
119 */
120function findJsFiles(dir, files = []) {
121 if (!existsSync(dir)) return files;
122
123 const entries = readdirSync(dir);
124 for (const entry of entries) {
125 const fullPath = join(dir, entry);
126 const stat = statSync(fullPath);
127 if (stat.isDirectory()) {
128 findJsFiles(fullPath, files);
129 } else if (entry.endsWith('.js') || entry.endsWith('.mjs')) {
130 files.push(fullPath);
131 }
132 }
133 return files;
134}
135
136/**
137 * Check if the dist files contain browser-incompatible imports

Callers 1

checkDistForNodeProtocolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected