Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/typingsInstaller/nodeTypingsInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ export class NodeTypingsInstaller extends TypingsInstaller {
this.typesRegistry = loadTypesRegistryFile(getTypesRegistryFileLocation(globalTypingsCacheLocation), this.installTypingHost, this.log);
}

listen() {
process.on("message", (req: TypingInstallerRequestUnion) => {
handleRequest(req: TypingInstallerRequestUnion) {
if (this.delayedInitializationError) {
// report initializationFailed error
this.sendResponse(this.delayedInitializationError);
Expand Down Expand Up @@ -200,7 +199,6 @@ export class NodeTypingsInstaller extends TypingsInstaller {
default:
Debug.assertNever(req);
}
});
}

protected sendResponse(response: TypingInstallerResponseUnion) {
Expand Down Expand Up @@ -272,8 +270,11 @@ process.on("disconnect", () => {
}
process.exit(0);
});
const installer = new NodeTypingsInstaller(globalTypingsCacheLocation!, typingSafeListLocation!, typesMapLocation!, npmLocation, validateDefaultNpmLocation, /*throttleLimit*/5, log); // TODO: GH#18217
installer.listen();
let installer: NodeTypingsInstaller | undefined;
process.on("message", (req: TypingInstallerRequestUnion) => {
installer ??= new NodeTypingsInstaller(globalTypingsCacheLocation!, typingSafeListLocation!, typesMapLocation!, npmLocation, validateDefaultNpmLocation, /*throttleLimit*/5, log); // TODO: GH#18217
installer.handleRequest(req);
});

function indent(newline: string, str: string | undefined): string {
return str && str.length
Expand Down