MCPcopy Index your code
hub / github.com/angular/angular / calcProjectFileAndBasePath

Function calcProjectFileAndBasePath

packages/compiler-cli/src/perform_compile.ts:62–73  ·  view source on GitHub ↗
(
  project: string,
  host: ConfigurationHost = getFileSystem(),
)

Source from the content-addressed store, hash-verified

60}
61
62export function calcProjectFileAndBasePath(
63 project: string,
64 host: ConfigurationHost = getFileSystem(),
65): {projectFile: AbsoluteFsPath; basePath: AbsoluteFsPath} {
66 const absProject = host.resolve(project);
67 const projectIsDir = host.lstat(absProject).isDirectory();
68 const projectFile = projectIsDir ? host.join(absProject, 'tsconfig.json') : absProject;
69 const projectDir = projectIsDir ? absProject : host.dirname(absProject);
70 const basePath = host.resolve(projectDir);
71
72 return {projectFile, basePath};
73}
74
75export function readConfiguration(
76 project: string,

Callers 1

readConfigurationFunction · 0.85

Calls 6

getFileSystemFunction · 0.90
resolveMethod · 0.65
isDirectoryMethod · 0.65
lstatMethod · 0.65
joinMethod · 0.65
dirnameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…