readFile may return undefined

This commit is contained in:
Andy Hanson
2017-07-14 14:26:13 -07:00
parent e8421827e0
commit 96d537bc54
16 changed files with 44 additions and 45 deletions

View File

@@ -217,7 +217,7 @@ namespace ts.server {
return !this.project.isWatchedMissingFile(path) && this.host.fileExists(file);
}
readFile(fileName: string): string {
readFile(fileName: string): string | undefined {
return this.host.readFile(fileName);
}

View File

@@ -93,10 +93,10 @@ namespace ts.server.typingsInstaller {
abstract readonly typesRegistry: Map<void>;
constructor(
readonly installTypingHost: InstallTypingHost,
readonly globalCachePath: string,
readonly safeListPath: Path,
readonly throttleLimit: number,
protected readonly installTypingHost: InstallTypingHost,
private readonly globalCachePath: string,
private readonly safeListPath: Path,
private readonly throttleLimit: number,
protected readonly log = nullLog) {
if (this.log.isEnabled()) {
this.log.writeLine(`Global cache location '${globalCachePath}', safe file path '${safeListPath}'`);