Skip to content

Commit 7be9dcd

Browse files
committed
npm run fmt
1 parent b892fe2 commit 7be9dcd

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ This library was influenced by the designs of:
2525

2626
## Comparison with Cap'n Web
2727

28-
Cap'n Web is an object-capabilities RPC library from [Kenton Varda](https://github.com/kentonv). Beyond its
28+
Cap'n Web is an object-capabilities RPC library from [Kenton Varda](https://github.com/kentonv). Beyond its
2929
support for object-capabilities, it is designed to integrate very nicely with TypeScript and Cloudflare Workers.
3030
I couldn't find a JSON-RPC library that worked as nicely, so I ~~stole its design~~ used Cap'n Web as inspiration
3131
for a JSON-RPC implementation.
3232

33-
Cap'n Web has a number of benefits over JSON-RPC
33+
Cap'n Web has a number of benefits over JSON-RPC
3434

3535
- **Object capabilities**. You can pass functions and classes by reference. This is more than a feature, it completely changes how expressive your API can be, and enables patterns that are not possible with a more limited RPC protocol.
3636
- **Pipelining**. Invoke two methods and then pass their results into a third in one round-trip.
@@ -90,11 +90,11 @@ export class HelloServiceImpl implements HelloService {
9090
export default {
9191
async fetch(request: Request, env: Env) {
9292
let url = new URL(request.url);
93-
93+
9494
if (url.pathname === "/api") {
9595
return newWorkersRpcResponse(request, new HelloServiceImpl());
9696
}
97-
97+
9898
return new Response("Not found", { status: 404 });
9999
},
100100
};
@@ -104,11 +104,11 @@ export default {
104104

105105
This library complies with the JSON-RPC 2.0 Spec, however it intentionally leaves out support for two features:
106106

107-
*Notifications*
107+
_Notifications_
108108

109109
Only requests are allowed. You can use a request with a `void` return if you do not need a response.
110110

111-
*Named arguments*
111+
_Named arguments_
112112

113113
In order to work nicely with TypeScript, we only accept positional arguments. Named params are
114114
rejected with `-32602 Invalid params`. Note that you can use one argment with an object as the

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"name": "@jmorrell/jsonrpc",
33
"version": "0.1.0",
4-
"publishConfig": {
5-
"access": "public"
6-
},
4+
"license": "MIT",
75
"files": [
86
"dist"
97
],
@@ -14,6 +12,9 @@
1412
"import": "./dist/index.js"
1513
}
1614
},
15+
"publishConfig": {
16+
"access": "public"
17+
},
1718
"scripts": {
1819
"build": "tsc",
1920
"typecheck": "tsc --noEmit",
@@ -32,6 +33,5 @@
3233
"oxlint": "^1.47.0",
3334
"typescript": "^5.7.0",
3435
"vitest": "^3.0.0"
35-
},
36-
"license": "MIT"
37-
}
36+
}
37+
}

0 commit comments

Comments
 (0)