MCPcopy Create free account
hub / github.com/cifertech/DisplayKit / walk

Function walk

scripts/generate_icon_manifests.mjs:15–31  ·  view source on GitHub ↗
(dir, baseDir)

Source from the content-addressed store, hash-verified

13}
14
15async function walk(dir, baseDir) {
16 const entries = await fs.readdir(dir, { withFileTypes: true });
17 const out = [];
18 for (const e of entries) {
19 const full = path.join(dir, e.name);
20 if (e.isDirectory()) {
21 // Skip node_modules or dot dirs if any
22 if (e.name.startsWith(".")) continue;
23 out.push(...(await walk(full, baseDir)));
24 } else if (e.isFile() && isPng(e.name)) {
25 const rel = path.relative(baseDir, full).split(path.sep).join("/");
26 // Only include files under icons/<size>/...
27 out.push(rel);
28 }
29 }
30 return out;
31}
32
33function sortFiles(files) {
34 return [...files].sort((a, b) => a.localeCompare(b, "en"));

Callers 1

mainFunction · 0.85

Calls 1

isPngFunction · 0.85

Tested by

no test coverage detected