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

Function getFileSystemEntries

compiler/companion/src/project/TypeScriptHosts.ts:17–31  ·  view source on GitHub ↗
(path: FilePath, fileManager: FileManager)

Source from the content-addressed store, hash-verified

15}
16
17function getFileSystemEntries(path: FilePath, fileManager: FileManager): FileSystemEntries {
18 const files: string[] = [];
19 const directories: string[] = [];
20 const entries = fileManager.getDirectories(path);
21
22 for (const entry of entries) {
23 if (fileManager.fileExists(entry)) {
24 files.push(entry.absolutePath);
25 } else if (fileManager.directoryExists(entry)) {
26 directories.push(entry.absolutePath);
27 }
28 }
29
30 return { files, directories };
31}
32
33class HostBase implements ts.FormatDiagnosticsHost {
34 constructor(readonly fileManager: FileManager) {}

Callers 1

readDirectoryMethod · 0.85

Calls 4

getDirectoriesMethod · 0.45
fileExistsMethod · 0.45
pushMethod · 0.45
directoryExistsMethod · 0.45

Tested by

no test coverage detected