🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

async-call-rpc

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-call-rpc - npm Package Compare versions

Comparing version

to
6.4.1

5

package.json
{
"name": "async-call-rpc",
"packageManager": "pnpm@8.15.1",
"version": "6.4.0",
"version": "6.4.1",
"description": "A lightweight JSON RPC server & client",

@@ -138,4 +138,5 @@ "main": "out/base.js",

"start": "run-p watch:rollup watch:tsc watch:test",
"test": "vitest --coverage"
"test": "vitest --coverage",
"ci:release": "node ./.github/publish.mjs && npx jsr publish && npx changeset publish"
}
}

14

src/Async-Call-Generator.ts
/**
* See the document at https://github.com/Jack-Works/async-call/
*/
import type { AsyncCallOptions } from './types.js'
import { AsyncCall } from './Async-Call.js'
import { AsyncCallIgnoreResponse } from './utils/internalSymbol.js'
import { normalizeStrictOptions } from './utils/normalizeOptions.js'
import { generateRandomID } from './utils/generateRandomID.js'
import { isFunction, isString, setPrototypeOf } from './utils/constants.js'
import type { AsyncCallOptions } from './types.ts'
import { AsyncCall } from './Async-Call.ts'
import { AsyncCallIgnoreResponse } from './utils/internalSymbol.ts'
import { normalizeStrictOptions } from './utils/normalizeOptions.ts'
import { generateRandomID } from './utils/generateRandomID.ts'
import { isFunction, isString, setPrototypeOf } from './utils/constants.ts'
import {

@@ -14,3 +14,3 @@ Err_Cannot_find_a_running_iterator_with_given_ID,

makeHostedMessage,
} from './utils/error.js'
} from './utils/error.ts'

@@ -17,0 +17,0 @@ const i = 'rpc.async-iterator.'

@@ -1,7 +0,7 @@

export * from './types.js'
export type { _IgnoreResponse } from './core/notify.js'
export { JSONSerialization, NoSerialization } from './utils/serialization.js'
export { JSONEncoder, type JSONEncoderOptions } from './utils/encoder.js'
export { notify } from './core/notify.js'
export { batch } from './core/batch.js'
export type * from './types.ts'
export type { _IgnoreResponse } from './core/notify.ts'
export { JSONSerialization, NoSerialization } from './utils/serialization.ts'
export { JSONEncoder, type JSONEncoderOptions } from './utils/encoder.ts'
export { notify } from './core/notify.ts'
export { batch } from './core/batch.ts'

@@ -17,3 +17,3 @@ import {

ErrorResponseParseError,
} from './utils/jsonrpc.js'
} from './utils/jsonrpc.ts'
import {

@@ -26,7 +26,7 @@ removeStackHeader,

onAbort,
} from './utils/error.js'
import { generateRandomID } from './utils/generateRandomID.js'
import { normalizeStrictOptions, normalizeLogOptions } from './utils/normalizeOptions.js'
import { AsyncCallIgnoreResponse, AsyncCallNotify, AsyncCallBatch } from './utils/internalSymbol.js'
import type { BatchQueue } from './core/batch.js'
} from './utils/error.ts'
import { generateRandomID } from './utils/generateRandomID.ts'
import { normalizeStrictOptions, normalizeLogOptions } from './utils/normalizeOptions.ts'
import { AsyncCallIgnoreResponse, AsyncCallNotify, AsyncCallBatch } from './utils/internalSymbol.ts'
import type { BatchQueue } from './core/batch.ts'
import type {

@@ -46,4 +46,4 @@ CallbackBasedChannel,

Responses,
} from './types.js'
import { apply, ERROR, isArray, isFunction, isObject, isString, Promise_resolve, undefined } from './utils/constants.js'
} from './types.ts'
import { apply, ERROR, isArray, isFunction, isObject, isString, Promise_resolve, undefined } from './utils/constants.ts'

@@ -50,0 +50,0 @@ /**

@@ -1,4 +0,4 @@

import { isString } from '../utils/constants.js'
import { AsyncCallBatch, AsyncCallNotify } from '../utils/internalSymbol.js'
import type { Request } from '../types.js'
import { isString } from '../utils/constants.ts'
import { AsyncCallBatch, AsyncCallNotify } from '../utils/internalSymbol.ts'
import type { Request } from '../types.ts'
/**

@@ -5,0 +5,0 @@ * Wrap the AsyncCall instance to use batch call.

@@ -1,3 +0,3 @@

import { AsyncCallNotify } from '../utils/internalSymbol.js'
import { isFunction } from '../utils/constants.js'
import { AsyncCallNotify } from '../utils/internalSymbol.ts'
import { isFunction } from '../utils/constants.ts'

@@ -4,0 +4,0 @@ /**

@@ -8,3 +8,3 @@ /**

export * from './Async-Call.js'
export * from './Async-Call-Generator.js'
export * from './Async-Call.ts'
export * from './Async-Call-Generator.ts'

@@ -1,3 +0,3 @@

import type { IsomorphicEncoder, Request, Requests, Response, Responses, SuccessResponse } from '../types.js'
import { isArray, undefined } from './constants.js'
import type { IsomorphicEncoder, Request, Requests, Response, Responses, SuccessResponse } from '../types.ts'
import { isArray, undefined } from './constants.ts'

@@ -65,3 +65,3 @@ /**

export namespace JSONEncoder {
export const Default = JSONEncoder()
export const Default: IsomorphicEncoder<unknown, unknown> = JSONEncoder()
}

@@ -1,2 +0,2 @@

import type { AbortSignalLike } from '../types.js'
import type { AbortSignalLike } from '../types.ts'

@@ -3,0 +3,0 @@ class CustomError extends Error {

@@ -1,8 +0,13 @@

import { globalDOMException as DOMException, DOMExceptionHeader } from './error.js'
import type { ErrorMapFunction } from '../Async-Call.js'
import { ERROR, isArray, isFunction, isObject, undefined } from './constants.js'
import type { Request, SuccessResponse, ErrorResponse, ID, Response } from '../types.js'
import { globalDOMException as DOMException, DOMExceptionHeader } from './error.ts'
import type { ErrorMapFunction } from '../Async-Call.ts'
import { ERROR, isArray, isFunction, isObject, undefined } from './constants.ts'
import type { Request, SuccessResponse, ErrorResponse, ID, Response } from '../types.ts'
export const jsonrpc = '2.0'
export const makeRequest = (id: ID, method: string, params: readonly unknown[] | object, remoteStack?: string): Request => {
export const makeRequest = (
id: ID,
method: string,
params: readonly unknown[] | object,
remoteStack?: string,
): Request => {
const x: Request = { jsonrpc, id, method, params, remoteStack }

@@ -68,3 +73,2 @@ deleteUndefined(x, 'id')

export const isJSONRPCObject = (data: any): data is Response | Request => {

@@ -71,0 +75,0 @@ if (!isObject(data)) return false

@@ -1,3 +0,3 @@

import type { AsyncCallOptions } from '../Async-Call.js'
import { isBoolean } from './constants.js'
import type { AsyncCallOptions } from '../Async-Call.ts'
import { isBoolean } from './constants.ts'
const undefinedToTrue = (x: undefined | boolean) => (x === void 0 ? true : x)

@@ -4,0 +4,0 @@ type NormalizedLogOptions = readonly [

@@ -1,3 +0,3 @@

import { isObject, undefined } from './constants.js'
import type { Serialization } from '../types.js'
import { isObject, undefined } from './constants.ts'
import type { Serialization } from '../types.ts'

@@ -4,0 +4,0 @@ /**

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet