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

Method readDirectory

compiler/companion/src/project/TypeScriptHosts.ts:48–75  ·  view source on GitHub ↗
(
    rootDir: string,
    extensions: readonly string[],
    excludes: readonly string[] | undefined,
    includes: readonly string[],
    depth?: number,
  )

Source from the content-addressed store, hash-verified

46 }
47
48 readDirectory(
49 rootDir: string,
50 extensions: readonly string[],
51 excludes: readonly string[] | undefined,
52 includes: readonly string[],
53 depth?: number,
54 ): string[] {
55 const currentDirectory = this.fileManager.getCurrentDirectory();
56
57 const output = matchFiles(
58 rootDir,
59 extensions,
60 excludes || [],
61 includes,
62 true,
63 currentDirectory,
64 depth,
65 (path) => {
66 // const includeDir = dirPathMatches(path);
67 const standardizedPath = this.fileManager.resolvePath(path);
68 return getFileSystemEntries(standardizedPath, this.fileManager);
69 },
70 (path) => this.fileManager.resolvePath(path).absolutePath,
71 (path) => this.fileManager.directoryExists(this.fileManager.resolvePath(path)),
72 );
73
74 return output;
75 }
76
77 getDirectories?(directoryName: string): string[] {
78 return this.fileManager.getDirectories(this.fileManager.resolvePath(directoryName)).map((p) => p.absolutePath);

Callers

nothing calls this directly

Calls 5

matchFilesFunction · 0.90
getFileSystemEntriesFunction · 0.85
getCurrentDirectoryMethod · 0.45
resolvePathMethod · 0.45
directoryExistsMethod · 0.45

Tested by

no test coverage detected