diff --git a/package.json b/package.json index 16a4f14..5de0fb6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "zeed", "type": "module", - "version": "0.20.1", + "version": "0.20.2", "description": "🌱 Simple foundation library", "author": { "name": "Dirk Holtwick", @@ -65,14 +65,14 @@ "watch": "nr build -- --watch src" }, "devDependencies": { - "@antfu/eslint-config": "^2.12.2", + "@antfu/eslint-config": "^2.13.0", "@antfu/ni": "^0.21.12", - "@types/node": "^20.12.5", + "@types/node": "^20.12.6", "@vitest/coverage-v8": "^1.4.0", "esbuild": "^0.20.2", "eslint": "^9.0.0", "tsup": "^8.0.2", - "typedoc": "^0.25.12", + "typedoc": "^0.25.13", "typescript": "^5.4.4", "vite": "^5.2.8", "vitest": "^1.4.0" diff --git a/src/common/msg/rpc.ts b/src/common/msg/rpc.ts index 156aedf..50442e6 100644 --- a/src/common/msg/rpc.ts +++ b/src/common/msg/rpc.ts @@ -18,6 +18,8 @@ export interface RPCOptionsBasic extends Pipe { onError?: (error: Error, functionName: string, args: any[]) => boolean | void /** Custom error handler for timeouts */ onTimeoutError?: (functionName: string, args: any[]) => boolean | void + /** Throw execptions. Default: true */ + exceptions?: boolean } export interface RPCOptions extends RPCOptionsBasic { @@ -68,6 +70,7 @@ function setupRPCBasic(options: RPCOptionsBasic, functions: any, eventNames: str onError, onTimeoutError, onlyEvents = false, + exceptions = true, } = options const rpcPromiseMap = new Map // Syntax test case -// const hub: UseRPCHubType = {} as any -// const x = hub({ -// test(name: string): string { -// return name -// }, -// }) -// await x.test('dsd') +// async function _demo() { +// const hub: UseRPCHubType = {} as any +// const x = hub({ +// test(name: string): string { +// return name +// }, +// }) +// await x.test('dsd') +// }