Skip to content

Commit 10723c1

Browse files
committed
style(reactive-rpc): 💄 run Prettier
1 parent 4f3628a commit 10723c1

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

src/reactive-rpc/server/uws/RpcApp.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export interface RpcAppOptions {
3737
* Serializers and de-serializers for request and response bodies.
3838
*/
3939
codecs?: Codecs;
40-
40+
4141
/**
4242
* HTTP port to listen on. If not specified, the PORT environment variable
4343
* will be used, or 9999 if not set.
@@ -72,8 +72,8 @@ export class RpcApp<Ctx extends ConnectionContext> {
7272

7373
constructor(protected readonly options: RpcAppOptions) {
7474
this.app = options.uws;
75-
this.maxRequestBodySize = options.maxRequestBodySize ?? 1024 * 1024,
76-
this.codecs = new RpcCodecs(options.codecs ?? new Codecs(new Writer()), new RpcMessageCodecs());
75+
(this.maxRequestBodySize = options.maxRequestBodySize ?? 1024 * 1024),
76+
(this.codecs = new RpcCodecs(options.codecs ?? new Codecs(new Writer()), new RpcMessageCodecs()));
7777
this.batchProcessor = new RpcMessageBatchProcessor<Ctx>({caller: options.caller});
7878
}
7979

@@ -256,7 +256,7 @@ export class RpcApp<Ctx extends ConnectionContext> {
256256
this.startRouting();
257257
const options = this.options;
258258
const port = options.port ?? +(process.env.PORT || 9999);
259-
const host = options.host ?? (process.env.HOST ?? '0.0.0.0');
259+
const host = options.host ?? process.env.HOST ?? '0.0.0.0';
260260
const logger = options.logger ?? console;
261261
this.options.uws.listen(host, port, (token) => {
262262
if (token) {

src/server/__tests__/pubsub.spec.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@ describe('pubsub', () => {
66
test('throws error on invalid input', async () => {
77
const {call} = setup();
88
try {
9-
await call(
10-
'pubsub.publish',
11-
{
12-
channel2: 'INVALID KEY',
13-
message: 'hello world',
14-
} as any,
15-
);
16-
throw new Error('should not reach here');
17-
} catch (err: any) {
18-
expect(err.meta.path).toStrictEqual(['channel2']);
19-
}
9+
await call('pubsub.publish', {
10+
channel2: 'INVALID KEY',
11+
message: 'hello world',
12+
} as any);
13+
throw new Error('should not reach here');
14+
} catch (err: any) {
15+
expect(err.meta.path).toStrictEqual(['channel2']);
16+
}
2017
});
2118

2219
test('can subscribe and receive published messages', async () => {

src/server/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Run: npx ts-node src/server/index.ts
22

33
import {App} from 'uWebSockets.js';
4-
import {RpcApp} from '../reactive-rpc/server/uws/RpcApp';;
4+
import {RpcApp} from '../reactive-rpc/server/uws/RpcApp';
55
import {createCaller} from './routes';
66
import {Services} from './services/Services';
77
import type {MyCtx} from './services/types';

0 commit comments

Comments
 (0)