@@ -7,7 +7,7 @@ import { Location } from "./location";
7
7
import { createPeer , InjectExpress } from "./app" ;
8
8
import { AppInfo } from "./appInfo" ;
9
9
import { getColorForId } from "./color" ;
10
- import { Instance as FrontendInstance } from ' ../types/instance' ;
10
+ import { Instance as FrontendInstance } from " ../types/instance" ;
11
11
12
12
export type Options = {
13
13
basePort : number ;
@@ -39,7 +39,7 @@ class Instance {
39
39
public app : expressWs . Application ,
40
40
public port : number ,
41
41
public url : string ,
42
- public webXdc : WebXdcMulti
42
+ public webXdc : WebXdcMulti ,
43
43
) {
44
44
this . id = port . toString ( ) ;
45
45
this . color = getColorForId ( this . id ) ;
@@ -52,7 +52,7 @@ class Instance {
52
52
}
53
53
54
54
close ( ) {
55
- this . server . close ( )
55
+ this . server . close ( ) ;
56
56
}
57
57
}
58
58
@@ -107,7 +107,7 @@ export class Instances {
107
107
app ,
108
108
port ,
109
109
instanceUrl ,
110
- this . processor . createClient ( port . toString ( ) )
110
+ this . processor . createClient ( port . toString ( ) ) ,
111
111
) ;
112
112
113
113
const wss = wsInstance . getWss ( ) ;
@@ -117,7 +117,7 @@ export class Instances {
117
117
ws . on ( "message" , ( msg : string ) => {
118
118
if ( typeof msg !== "string" ) {
119
119
console . error (
120
- "webxdc: Don't know how to handle unexpected non-string data"
120
+ "webxdc: Don't know how to handle unexpected non-string data" ,
121
121
) ;
122
122
return ;
123
123
}
@@ -133,7 +133,7 @@ export class Instances {
133
133
JSON . stringify ( {
134
134
type : "updates" ,
135
135
updates : updates . map ( ( [ update ] ) => update ) ,
136
- } )
136
+ } ) ,
137
137
) ;
138
138
} ,
139
139
parsed . serial ,
@@ -152,7 +152,7 @@ export class Instances {
152
152
name : this . appInfo . manifest . name ,
153
153
color : instance . color ,
154
154
} ,
155
- } )
155
+ } ) ,
156
156
) ;
157
157
} else {
158
158
throw new Error ( `Unknown message: ${ JSON . stringify ( parsed ) } ` ) ;
@@ -166,7 +166,9 @@ export class Instances {
166
166
delete ( id : number ) {
167
167
let instance = this . instances . get ( id ) ;
168
168
if ( instance == null ) {
169
- throw new Error ( `Instance with id ${ id } can't be deleted because it does not exist` ) ;
169
+ throw new Error (
170
+ `Instance with id ${ id } can't be deleted because it does not exist` ,
171
+ ) ;
170
172
}
171
173
instance . close ( ) ;
172
174
this . processor . removeClient ( instance . id ) ;
@@ -187,13 +189,13 @@ export class Instances {
187
189
this . _onMessage = onMessage ;
188
190
}
189
191
190
- list ( ) : FrontendInstance [ ] {
192
+ list ( ) : FrontendInstance [ ] {
191
193
return Array . from ( this . instances . values ( ) ) . map ( ( instance ) => ( {
192
194
id : instance . id ,
193
195
port : instance . port ,
194
196
url : instance . url ,
195
197
color : instance . color ,
196
- } ) )
198
+ } ) ) ;
197
199
}
198
200
}
199
201
@@ -215,7 +217,7 @@ function isSendUpdateMessage(value: any): value is SendUpdateMessage {
215
217
}
216
218
217
219
function isSetUpdateListenerMessage (
218
- value : any
220
+ value : any ,
219
221
) : value is SetUpdateListenerMessage {
220
222
return value . type === "setUpdateListener" ;
221
223
}
0 commit comments