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

@matrixai/rpc

Package Overview
Dependencies
Maintainers
0
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@matrixai/rpc - npm Package Compare versions

Comparing version 0.5.1 to 0.6.0

flake.lock

39

dist/RPCServer.js

@@ -48,2 +48,37 @@ "use strict";

const cleanupReason = Symbol('CleanupReason');
function composeErrorMessage(error) {
switch (typeof error) {
case 'boolean':
case 'number':
case 'string':
case 'bigint':
case 'symbol':
return `Non-error literal ${String(error)} was thrown`;
case 'object':
// Let the fallback handler catch null values.
if (error == null)
break;
// If we have an error message defined, then return that.
if ('message' in error && typeof error.message === 'string') {
return error.message;
}
// If present, mention the constructor name in the message.
if (error.constructor?.name != null) {
return `Non-error object ${error.constructor.name} was thrown`;
}
// Any other values should be handled by the fallback handler.
break;
}
// Handle cases where the error is not serialisable, like objects created
// using Object.create(null). Trying to serialise this throws a TypeError.
try {
return `Non-error value ${String(error)} was thrown`;
}
catch (e) {
if (e instanceof TypeError)
return 'Non-error value was thrown';
else
throw e;
}
}
let RPCServer = class RPCServer {

@@ -249,3 +284,3 @@ idGen;

code: -32006 /* errors.JSONRPCResponseErrorCode.RPCRemote */,
message: e.message,
message: composeErrorMessage(e),
data: this.fromError(e),

@@ -441,3 +476,3 @@ };

code: -32006 /* errors.JSONRPCResponseErrorCode.RPCRemote */,
message: e.message,
message: composeErrorMessage(e),
data: this.fromError(e),

@@ -444,0 +479,0 @@ };

2

package.json
{
"name": "@matrixai/rpc",
"version": "0.5.1",
"version": "0.6.0",
"author": "Matrix AI",

@@ -5,0 +5,0 @@ "contributors": [

# js-rpc
staging:[![pipeline status](https://gitlab.com/MatrixAI/open-source/js-rpc/badges/staging/pipeline.svg)](https://gitlab.com/MatrixAI/open-source/js-rpc/commits/staging)
master:[![pipeline status](https://gitlab.com/MatrixAI/open-source/js-rpc/badges/master/pipeline.svg)](https://gitlab.com/MatrixAI/open-source/js-rpc/commits/master)
## Installation

@@ -7,0 +4,0 @@

Sorry, the diff of this file is not supported yet

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