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

Method fileExists

packages/compiler-cli/src/ngtsc/core/src/host.ts:323–335  ·  view source on GitHub ↗
(fileName: string)

Source from the content-addressed store, hash-verified

321 }
322
323 fileExists(fileName: string): boolean {
324 // Consider the file as existing whenever
325 // 1) it really does exist in the delegate host, or
326 // 2) at least one of the shim generators recognizes it
327 // Note that we can pass the file name as branded absolute fs path because TypeScript
328 // internally only passes POSIX-like paths.
329 //
330 // Also note that the `maybeGenerate` check below checks for both `null` and `undefined`.
331 return (
332 this.delegate.fileExists(fileName) ||
333 this.shimAdapter.maybeGenerate(resolve(fileName)) != null
334 );
335 }
336
337 get unifiedModulesHost(): UnifiedModulesHost | null {
338 return this.fileNameToModuleName !== undefined ? (this as UnifiedModulesHost) : null;

Callers 2

fallbackResolveMethod · 0.45
fileExistsFunction · 0.45

Calls 2

resolveFunction · 0.90
maybeGenerateMethod · 0.80

Tested by

no test coverage detected