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

vscode-jsonrpc

Package Overview
Dependencies
Maintainers
9
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 2.3.0 to 2.3.1

41

lib/main.js

@@ -74,2 +74,5 @@ /* --------------------------------------------------------------------------------------------

}
function isClosed() {
return state === ConnectionState.Closed;
}
function isDisposed() {

@@ -338,8 +341,18 @@ return state === ConnectionState.Disposed;

};
var disposedMessage = 'Connection is disposed';
function throwIfClosedOrDisposed() {
if (isClosed()) {
throw new Error('Connection is closed.');
}
if (isDisposed()) {
throw new Error('Connection is disposed.');
}
}
function throwIfListening() {
if (isListening()) {
throw new Error('Connection is already listening');
}
}
var connection = {
sendNotification: function (type, params) {
if (isDisposed()) {
throw new Error(disposedMessage);
}
throwIfClosedOrDisposed();
var notificatioMessage = {

@@ -356,11 +369,7 @@ jsonrpc: version,

onNotification: function (type, handler) {
if (isDisposed()) {
throw new Error(disposedMessage);
}
throwIfClosedOrDisposed();
eventHandlers[type.method] = handler;
},
sendRequest: function (type, params, token) {
if (isDisposed()) {
throw new Error(disposedMessage);
}
throwIfClosedOrDisposed();
var id = sequenceNumber++;

@@ -398,5 +407,3 @@ var result = new Promise(function (resolve, reject) {

onRequest: function (type, handler) {
if (isDisposed()) {
throw new Error(disposedMessage);
}
throwIfClosedOrDisposed();
requestHandlers[type.method] = handler;

@@ -431,8 +438,4 @@ },

listen: function () {
if (isDisposed()) {
throw new Error(disposedMessage);
}
if (isListening()) {
throw new Error('Conneciton is already listening');
}
throwIfClosedOrDisposed();
throwIfListening();
state = ConnectionState.Listening;

@@ -439,0 +442,0 @@ messageReader.listen(callback);

{
"name": "vscode-jsonrpc",
"description": "A json rpc implementation over streams",
"version": "2.3.0",
"version": "2.3.1",
"author": "Microsoft Corporation",

@@ -6,0 +6,0 @@ "license": "MIT",

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