MCPcopy Create free account
hub / github.com/Snapchat/Valdi / traverseDirectories

Function traverseDirectories

npm_modules/cli/src/utils/fileUtils.ts:98–108  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

96
97 const files: string[] = [];
98 function traverseDirectories(dir: string) {
99 fs.readdirSync(dir, { withFileTypes: true }).forEach(file => {
100 const fullPath = path.join(dir, file.name);
101 if (file.isDirectory()) {
102 traverseDirectories(fullPath);
103 return;
104 }
105
106 files.push(fullPath);
107 });
108 }
109
110 traverseDirectories(directoryPath);
111

Callers 1

getAllFilePathsFunction · 0.85

Calls 4

forEachMethod · 0.65
joinMethod · 0.45
isDirectoryMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected