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

rpc-utils

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rpc-utils - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

2

dist/rpc-utils.cjs.development.js

@@ -1118,2 +1118,4 @@ 'use strict';

_context.prev = 12;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore params can be undefined
handled = handler(ctx, msg.params);

@@ -1120,0 +1122,0 @@

@@ -1116,2 +1116,4 @@ import { nanoid } from 'nanoid';

_context.prev = 12;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore params can be undefined
handled = handler(ctx, msg.params);

@@ -1118,0 +1120,0 @@

2

dist/server.d.ts
import type { RPCErrorResponse, RPCMethods, RPCRequest, RPCResponse, RPCResultResponse } from './types';
export declare type ErrorHandler<Context, Methods extends RPCMethods> = <K extends keyof Methods>(ctx: Context, req: RPCRequest<Methods, K>, error: Error) => void;
export declare type MethodHandler<Context, Params, Result> = (ctx: Context, params?: Params) => Result | Promise<Result>;
export declare type MethodHandler<Context, Params = undefined, Result = undefined> = Params extends undefined ? (ctx: Context, params?: undefined) => Result | Promise<Result> : (ctx: Context, params: Params) => Result | Promise<Result>;
export declare type NotificationHandler<Context, Methods extends RPCMethods> = <K extends keyof Methods>(ctx: Context, req: RPCRequest<Methods, K>) => void;

@@ -5,0 +5,0 @@ export declare type HandlerMethods<Context, Methods extends RPCMethods> = {

{
"name": "rpc-utils",
"version": "0.3.1",
"version": "0.3.2",
"author": "Paul Le Cam <paul@3box.io>",

@@ -26,6 +26,6 @@ "license": "(Apache-2.0 OR MIT)",

"dependencies": {
"nanoid": "^3.1.20"
"nanoid": "^3.1.21"
},
"devDependencies": {
"@size-limit/preset-small-lib": "^4.9.2",
"@size-limit/preset-small-lib": "^4.10.1",
"@types/nanoid": "^2.1.0",

@@ -36,6 +36,6 @@ "eslint": "^7.21.0",

"prettier": "^2.2.1",
"size-limit": "^4.9.2",
"size-limit": "^4.10.1",
"tsdx": "^0.14.1",
"tslib": "^2.1.0",
"typescript": "^4.2.2"
"typescript": "^4.2.3"
},

@@ -42,0 +42,0 @@ "husky": {

@@ -16,6 +16,9 @@ import { ERROR_CODE, RPCError, createParseError, getErrorMessage } from './error'

export type MethodHandler<Context, Params, Result> = (
ctx: Context,
params?: Params
) => Result | Promise<Result>
export type MethodHandler<
Context,
Params = undefined,
Result = undefined
> = Params extends undefined
? (ctx: Context, params?: undefined) => Result | Promise<Result>
: (ctx: Context, params: Params) => Result | Promise<Result>

@@ -108,2 +111,4 @@ export type NotificationHandler<Context, Methods extends RPCMethods> = <K extends keyof Methods>(

try {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore params can be undefined
const handled = handler(ctx, msg.params)

@@ -110,0 +115,0 @@ const result =

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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