mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 20:25:23 -06:00
Refactor to avoid errors
This commit is contained in:
parent
ee5e8e3eee
commit
b0321dc177
@ -55,7 +55,7 @@ namespace ts.server.typingsInstaller {
|
||||
try {
|
||||
if (fileExists) {
|
||||
const content = <TypeDeclarationTimestampFile>JSON.parse(host.readFile(typeDeclarationTimestampFilePath));
|
||||
return content.entries;
|
||||
return content.entries || {};
|
||||
}
|
||||
else {
|
||||
host.writeFile(typeDeclarationTimestampFilePath, "{}");
|
||||
@ -247,10 +247,11 @@ namespace ts.server.typingsInstaller {
|
||||
continue;
|
||||
}
|
||||
const existingTypingFile = this.packageNameToTypingLocation.get(packageName);
|
||||
if (existingTypingFile.typingLocation === typingFile) {
|
||||
continue;
|
||||
}
|
||||
if (existingTypingFile) {
|
||||
if (existingTypingFile.typingLocation === typingFile) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (this.log.isEnabled()) {
|
||||
this.log.writeLine(`New typing for package ${packageName} from '${typingFile}' conflicts with existing typing file '${existingTypingFile}'`);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user