MCPcopy Create free account
hub / github.com/bufferhead-code/nextjs-use-php / fromDir

Function fromDir

build.ts:65–82  ·  view source on GitHub ↗
(startPath: any, filter: any, callback: any)

Source from the content-addressed store, hash-verified

63}
64
65function fromDir(startPath: any, filter: any, callback: any) {
66
67 if (!fs.existsSync(startPath)) {
68 console.log("no dir ", startPath);
69 return;
70 }
71
72 var files = fs.readdirSync(startPath);
73 for (var i = 0; i < files.length; i++) {
74 var filename = path.join(startPath, files[i]);
75 var stat = fs.lstatSync(filename);
76 if (stat.isDirectory() && filename.startsWith('node_modules') === false && filename.startsWith('.next') === false) {
77 fromDir(filename, filter, callback); //recurse
78 } else if (filename.endsWith(filter)) {
79 callback(filename);
80 };
81 };
82};
83
84
85build();

Callers 1

buildFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected