Socket
Socket
Sign inDemoInstall

vscode-jsonrpc

Package Overview
Dependencies
Maintainers
7
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-jsonrpc - npm Package Compare versions

Comparing version 8.2.0 to 8.2.1-next.1

24

lib/node/main.js

@@ -27,2 +27,3 @@ "use strict";

const os = require("os");
const fs = require("fs");
const crypto_1 = require("crypto");

@@ -159,18 +160,17 @@ const net_1 = require("net");

function generateRandomPipeName() {
const randomSuffix = (0, crypto_1.randomBytes)(21).toString('hex');
if (process.platform === 'win32') {
return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`;
return `\\\\.\\pipe\\lsp-${(0, crypto_1.randomBytes)(16).toString('hex')}-sock`;
}
let result;
if (XDG_RUNTIME_DIR) {
result = path.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`);
let randomLength = 32;
const fixedLength = 'lsp-.sock'.length;
const tmpDir = fs.realpathSync(XDG_RUNTIME_DIR ?? os.tmpdir());
const limit = safeIpcPathLengths.get(process.platform);
if (limit !== undefined) {
randomLength = Math.min(limit - tmpDir.length - fixedLength, randomLength);
}
else {
result = path.join(os.tmpdir(), `vscode-${randomSuffix}.sock`);
if (randomLength < 16) {
throw new Error(`Unable to generate a random pipe name with ${randomLength} characters.`);
}
const limit = safeIpcPathLengths.get(process.platform);
if (limit !== undefined && result.length > limit) {
(0, ril_1.default)().console.warn(`WARNING: IPC handle "${result}" is longer than ${limit} characters.`);
}
return result;
const randomSuffix = (0, crypto_1.randomBytes)(Math.floor(randomLength / 2)).toString('hex');
return path.join(tmpDir, `lsp-${randomSuffix}.sock`);
}

@@ -177,0 +177,0 @@ exports.generateRandomPipeName = generateRandomPipeName;

{
"name": "vscode-jsonrpc",
"description": "A json rpc implementation over streams",
"version": "8.2.0",
"version": "8.2.1-next.1",
"author": "Microsoft Corporation",

@@ -24,3 +24,3 @@ "license": "MIT",

"devDependencies": {
"@types/msgpack-lite": "^0.1.7",
"@types/msgpack-lite": "^0.1.10",
"msgpack-lite": "^0.1.26"

@@ -27,0 +27,0 @@ },

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