MCPcopy Create free account
hub / github.com/GCWing/BitFun / listFiles

Function listFiles

scripts/i18n-contract.test.mjs:88–98  ·  view source on GitHub ↗
(dir, predicate)

Source from the content-addressed store, hash-verified

86}
87
88function listFiles(dir, predicate) {
89 const entries = fs.readdirSync(dir, { withFileTypes: true });
90 return entries.flatMap((entry) => {
91 const absolutePath = path.join(dir, entry.name);
92 if (entry.isDirectory()) {
93 return listFiles(absolutePath, predicate);
94 }
95
96 return predicate(absolutePath) ? [absolutePath] : [];
97 });
98}
99
100function extractStringArrayConstant(source, exportName) {
101 const marker = `export const ${exportName} = [`;

Callers 1

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected