MCPcopy
hub / github.com/MisterBooo/LeetCodeAnimation / findFirstGif

Function findFirstGif

tools/scripts/sync-algomooc-index.js:90–107  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

88}
89
90function findFirstGif(dir) {
91 if (!dir) return null;
92 const animationDir = path.join(ROOT, dir, "Animation");
93 if (!fs.existsSync(animationDir)) return null;
94 const stack = [animationDir];
95
96 while (stack.length) {
97 const current = stack.pop();
98 const entries = fs.readdirSync(current, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name));
99 for (const entry of entries) {
100 const full = path.join(current, entry.name);
101 if (entry.isDirectory()) stack.push(full);
102 if (entry.isFile() && /\.gif$/i.test(entry.name)) return path.relative(ROOT, full).split(path.sep).join("/");
103 }
104 }
105
106 return null;
107}
108
109function buildManifest() {
110 const dirs = problemDirs();

Callers 1

buildManifestFunction · 0.85

Calls 2

popMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected