MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / collectFilesRecursiveSorted

Function collectFilesRecursiveSorted

scripts/run-tests.mjs:26–45  ·  view source on GitHub ↗
(dir, predicate)

Source from the content-addressed store, hash-verified

24}
25
26function collectFilesRecursiveSorted(dir, predicate) {
27 const out = [];
28
29 function walk(d) {
30 const entries = listDirSorted(d);
31 for (const name of entries) {
32 const full = join(d, name);
33 const st = statSync(full);
34 if (st.isDirectory()) {
35 walk(full);
36 continue;
37 }
38 if (predicate(full)) out.push(full);
39 }
40 }
41
42 walk(dir);
43 out.sort();
44 return out;
45}
46
47function collectScriptTests(root) {
48 const dir = join(root, "scripts", "__tests__");

Callers 2

collectScriptTestsFunction · 0.70
collectPackageTestsFunction · 0.70

Calls 1

walkFunction · 0.70

Tested by

no test coverage detected