MCPcopy Index your code
hub / github.com/omkarcloud/botasaurus / getJsFilesRecursively

Function getJsFilesRecursively

js/botasaurus-js/minify-script.js:30–45  ·  view source on GitHub ↗
(directory)

Source from the content-addressed store, hash-verified

28}
29
30async function getJsFilesRecursively(directory) {
31 let jsFiles = [];
32 const items = await fs.promises.readdir(directory, { withFileTypes: true });
33
34 for (const item of items) {
35 const fullPath = path.join(directory, item.name);
36 if (item.isDirectory()) {
37 jsFiles = jsFiles.concat(await getJsFilesRecursively(fullPath));
38 } else if (path.extname(item.name).toLowerCase() === '.js') {
39 jsFiles.push(fullPath);
40 }
41 }
42
43
44 return jsFiles;
45}
46
47async function getFilesRecursively(directory) {
48 let jsFiles = [];

Callers 2

getFilesRecursivelyFunction · 0.70
minifyAllJsFilesFunction · 0.70

Calls 2

joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected