New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

arc-rpc

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arc-rpc - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

38

index.js

@@ -53,3 +53,3 @@ 'use strict'; // always strict mode

// Give child class instance a copy of this/RPC
if (child._handleRpc != null) child._handleRpc (this);
if (child != null && child._handleRpc != null) child._handleRpc (this);

@@ -112,6 +112,18 @@ // Set private variables

let params = call.params.map ((param) => {
if (param.isFunc) {
return (...fnParams) => {
this._stream.send ('cbRes.' + param.funcId, {
params: fnParams,
});
}
} else {
return param.data;
}
})
// Try getting response from handler or handle error
try {
// Run with applied params and await result
response = await handler (...call.params);
response = await handler (...params);
} catch (err) {

@@ -139,2 +151,22 @@ // Emit error as response

let parsedParams = params.map ((param) => {
if (typeof param == "function") {
let funcId = uuid ();
this._stream.on ('cbRes.' + funcId, (res) => {
param (...res.params);
});
return {
isFunc: true,
funcId: funcId,
}
} else {
return {
isFunc: false,
data: param,
}
}
});
// Emit the remote call event

@@ -144,3 +176,3 @@ this._stream.send ('fnCall', {

resId: resId,
params: params,
params: parsedParams,
});

@@ -147,0 +179,0 @@

2

package.json
{
"name": "arc-rpc",
"version": "1.3.3",
"version": "1.3.4",
"description": "Asynchronous Remote Classes make RPC simple",

@@ -5,0 +5,0 @@ "main": "index.js",

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