MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / visit

Function visit

packages/playground/vite.plugin.server.ts:53–74  ·  view source on GitHub ↗
(dir: string, name: string)

Source from the content-addressed store, hash-verified

51function crawlNewReferenceFiles(testDataPath: string): TestResultEntry[] {
52 const out: TestResultEntry[] = [];
53 function visit(dir: string, name: string): void {
54 const handle = fs.opendirSync(dir);
55 try {
56 while (true) {
57 const entry = handle.readSync();
58 if (!entry) {
59 break;
60 }
61 if (entry.isDirectory() && entry.name !== '.' && entry.name !== '..') {
62 visit(path.join(dir, entry.name), `${name}/${entry.name}`);
63 } else if (entry.isFile() && entry.name.endsWith('.new.png')) {
64 out.push({
65 originalFile: `${name}/${entry.name.replace('.new.png', '.png')}`,
66 newFile: `${name}/${entry.name}`,
67 diffFile: `${name}/${entry.name.replace('.new.png', '.diff.png')}`
68 });
69 }
70 }
71 } finally {
72 handle.close();
73 }
74 }
75 visit(testDataPath, 'test-data');
76 return out;
77}

Callers 2

crawlNewReferenceFilesFunction · 0.85
walkFunction · 0.85

Calls 4

replaceMethod · 0.80
joinMethod · 0.45
pushMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected