in eng/tools/typespec-migration-validation/src/helper.ts [18:41]
function traverseDirectory(currentPath: string): void {
const files = fs.readdirSync(currentPath);
for (const file of files) {
const filePath = path.join(currentPath, file);
const stats = fs.statSync(filePath);
// Skip paths containing the exclude pattern
if (filePath.toLowerCase().includes(excludePattern.toLowerCase())) {
continue;
}
// Skip paths that are not json files
if (!filePath.endsWith('.json')) {
continue;
}
if (stats.isDirectory()) {
traverseDirectory(filePath);
} else {
results.push(filePath);
}
}
}