Skip to content

Commit 63f3b90

Browse files
committed
prettier
more renames
1 parent f1635e0 commit 63f3b90

File tree

6 files changed

+13
-21
lines changed

6 files changed

+13
-21
lines changed

backend/instance.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class Instances {
132132
wss,
133133
JSON.stringify({
134134
type: "updates",
135-
updates: updates.map(([update]) => update),
135+
updates: updates.map((update) => update),
136136
}),
137137
);
138138
},

backend/message.test.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test("distribute to self", () => {
2727
return true;
2828
}, 0);
2929

30-
client0.sendUpdate({ payload: "Hello" }, "") ;
30+
client0.sendUpdate({ payload: "Hello" }, "");
3131

3232
expect(client0Heard).toMatchObject([
3333
{ payload: "Hello", serial: 1, max_serial: 1 },
@@ -80,7 +80,7 @@ test("distribute to self and other", () => {
8080
]);
8181
expect(client1Heard).toMatchObject([
8282
{ payload: "Hello", serial: 1, max_serial: 1 },
83-
{ payload: "Bye", serial: 2, max_serial: 2 }
83+
{ payload: "Bye", serial: 2, max_serial: 2 },
8484
]);
8585

8686
expect(prepare(getMessages())).toEqual([
@@ -652,7 +652,6 @@ test("distribute to self and other, but other was disconnected", () => {
652652
type: "sent",
653653
instanceId: "3001",
654654
update: { payload: "Hello", serial: 1, max_serial: 1 },
655-
656655
},
657656
{
658657
type: "received",

backend/message.ts

+3-10
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import type {
66
import type { Message } from "../types/message";
77
import { getColorForId } from "./color";
88

9-
type UpdateListenerMulti = (
10-
updates: ReceivedStatusUpdate<any>[],
11-
) => boolean;
9+
type UpdateListenerMulti = (updates: ReceivedStatusUpdate<any>[]) => boolean;
1210

1311
type ClearListener = () => boolean;
1412
type DeleteListener = () => boolean;
@@ -150,10 +148,7 @@ class Processor implements IProcessor {
150148
this.clients.splice(client_index, 1);
151149
}
152150

153-
distribute(
154-
instanceId: string,
155-
update: SendingStatusUpdate<any>,
156-
) {
151+
distribute(instanceId: string, update: SendingStatusUpdate<any>) {
157152
this.currentSerial++;
158153
const receivedUpdate: ReceivedStatusUpdate<any> = {
159154
...update,
@@ -187,9 +182,7 @@ class Processor implements IProcessor {
187182
updateListener(
188183
this.updates
189184
.slice(serial)
190-
.map((update) =>
191-
({ ...update, max_serial: maxSerial })
192-
),
185+
.map((update) => ({ ...update, max_serial: maxSerial })),
193186
);
194187
}
195188
}

sim/create.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { WebXdc, ReceivedStatusUpdate } from "@webxdc/types";
1+
import { Webxdc, ReceivedStatusUpdate } from "@webxdc/types";
22

33
type UpdatesMessage = {
44
type: "updates";
@@ -45,11 +45,11 @@ type Log = (...args: any[]) => void;
4545
export function createWebXdc(
4646
transport: Transport,
4747
log: Log = () => {},
48-
): WebXdc<any> {
48+
): Webxdc<any> {
4949
let resolveUpdateListenerPromise: (() => void) | null = null;
5050

51-
const webXdc: WebXdc<any> = {
52-
sendUpdate: (update) => {
51+
const webXdc: Webxdc<any> = {
52+
sendUpdate: (update: any) => {
5353
transport.send({ type: "sendUpdate", update });
5454
log("send", { update });
5555
},

sim/webxdc.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class FakeTransport implements Transport {
2727

2828
send(data: any) {
2929
if (data.type === "sendUpdate") {
30-
const { update} = data;
30+
const { update } = data;
3131
this.client.sendUpdate(update, "");
3232
} else if (data.type === "setUpdateListener") {
3333
this.client.connect(

sim/webxdc.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { WebXdc } from "@webxdc/types";
1+
import { Webxdc } from "@webxdc/types";
22
import {
33
Transport,
44
TransportMessageCallback,
@@ -114,7 +114,7 @@ export class DevServerTransport implements Transport {
114114
}
115115
}
116116

117-
function getWebXdc(): WebXdc<any> {
117+
function getWebXdc(): Webxdc<any> {
118118
return (window as any).webxdc;
119119
}
120120

0 commit comments

Comments
 (0)