Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@typescript/server-replay

Package Overview
Dependencies
Maintainers
8
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typescript/server-replay - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

4

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/microsoft/typescript-server-replay#readme",
"version": "0.2.2",
"version": "0.2.3",
"license": "MIT",

@@ -32,3 +32,3 @@ "description": "Replay server requests from a file",

"dependencies": {
"@typescript/server-harness": "^0.1.4",
"@typescript/server-harness": "^0.2.0",
"yargs": "^16.2.0"

@@ -35,0 +35,0 @@ },

@@ -114,4 +114,8 @@ const sh = require("@typescript/server-harness");

}
sawExit = sawExit || request.command === "exit";
requests.push(request);
// Drop exit requests in unattended mode - we need to tear down more explicitly
const isExit = request.command === "exit";
sawExit = sawExit || isExit;
if (!isExit || !unattended) {
requests.push(request);
}
}

@@ -130,5 +134,4 @@ catch {

const synthesizedExitRequest = { "seq": 999999, "command": "exit" };
if (!sawExit) {
requests.push(synthesizedExitRequest);
if (!sawExit && !unattended) {
requests.push({ "seq": 999999, "command": "exit" });
}

@@ -162,5 +165,5 @@

if (!unattended || !exitRequested || code) {
console.log(`${exitRequested ? "Shut down" :"Exited unexpectedly"}${code ? ` with code ${code}` : ""}`);
console.log(`${exitRequested ? "Shut down" : "Exited unexpectedly"}${code ? ` with code ${code}` : ""}`);
}
if (unattended) {
if (unattended && !exitRequested) {
process.exit(3);

@@ -175,3 +178,3 @@ }

try {
await server.message(synthesizedExitRequest);
await exitOrKillServer();
}

@@ -194,6 +197,6 @@ catch {

try {
exitRequested = true;
await server.message(synthesizedExitRequest);
await exitOrKillServer();
}
catch {
// Ignore errors during shutdown
}

@@ -207,2 +210,14 @@ process.exit(5);

}
if (unattended) {
if (!await exitOrKillServer()) {
// Server didn't exit cleanly and had to be killed
process.exit(6);
}
}
async function exitOrKillServer() {
exitRequested = true; // Suppress "exit" event handler
return await server.exitOrKill(5000);
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc