@@ -94,15 +94,15 @@ async function listenIDECommands(callback) {
9494 if ( msg . type === 'success' && msg . payload . result . method ) {
9595 const result = await callback (
9696 msg . payload . result . method ,
97- msg . payload . result . params
97+ msg . payload . result . params ,
9898 ) ;
9999 ws . send (
100100 JSON . stringify (
101101 jsonrpc . request ( Math . random ( ) . toString ( ) , 'ide.on_command_result' , [
102102 msg . payload . result . id ,
103103 result ,
104- ] )
105- )
104+ ] ) ,
105+ ) ,
106106 ) ;
107107 } else if ( msg . type === 'error' ) {
108108 console . error ( 'Errored WS result: ' , msg . payload ) ;
@@ -111,7 +111,7 @@ async function listenIDECommands(callback) {
111111 console . error ( 'Invalid RPC message: ' , err ) ;
112112 }
113113 ws . send (
114- JSON . stringify ( jsonrpc . request ( Math . random ( ) . toString ( ) , 'ide.listen_commands' ) )
114+ JSON . stringify ( jsonrpc . request ( Math . random ( ) . toString ( ) , 'ide.listen_commands' ) ) ,
115115 ) ;
116116 } ) ;
117117}
@@ -124,7 +124,7 @@ async function isPortUsed(port, host) {
124124 } ,
125125 ( ) => {
126126 return resolve ( false ) ;
127- }
127+ } ,
128128 ) ;
129129 } ) ;
130130}
@@ -133,7 +133,7 @@ async function findFreePort() {
133133 let attemptNums = 0 ;
134134 while ( attemptNums < 13 ) {
135135 const port = Math . floor (
136- Math . random ( ) * ( HTTP_PORT_MAX - HTTP_PORT_MIN ) + HTTP_PORT_MIN
136+ Math . random ( ) * ( HTTP_PORT_MAX - HTTP_PORT_MIN ) + HTTP_PORT_MIN ,
137137 ) ;
138138 if ( ! ( await isPortUsed ( port , _HTTP_HOST ) ) ) {
139139 return port ;
@@ -179,7 +179,7 @@ async function _ensureServerStarted(options = {}) {
179179 await new Promise ( ( resolve , reject ) => {
180180 const timeoutID = setTimeout (
181181 ( ) => reject ( new Error ( 'Could not start PIO Home server: Timeout error' ) ) ,
182- SERVER_LAUNCH_TIMEOUT * 1000
182+ SERVER_LAUNCH_TIMEOUT * 1000 ,
183183 ) ;
184184 let output = '' ;
185185 runPIOCommand (
@@ -209,7 +209,7 @@ async function _ensureServerStarted(options = {}) {
209209 resolve ( true ) ;
210210 }
211211 } ,
212- }
212+ } ,
213213 ) ;
214214 } ) ;
215215 }
@@ -240,10 +240,10 @@ export async function shutdownAllServers() {
240240 try {
241241 got (
242242 constructServerUrl ( { port, includeSID : false , query : { __shutdown__ : '1' } } ) ,
243- { timeout : 1000 , throwHttpErrors : false }
243+ { timeout : 1000 , throwHttpErrors : false } ,
244244 ) . then (
245245 ( ) => { } ,
246- ( ) => { }
246+ ( ) => { } ,
247247 ) ;
248248 } catch ( err ) { }
249249 port ++ ;
@@ -254,7 +254,7 @@ export async function shutdownAllServers() {
254254function loadState ( ) {
255255 try {
256256 return JSON . parse (
257- fs . readFileSync ( path . join ( getCoreDir ( ) , 'homestate.json' ) , { encoding : 'utf-8' } )
257+ fs . readFileSync ( path . join ( getCoreDir ( ) , 'homestate.json' ) , { encoding : 'utf-8' } ) ,
258258 ) ;
259259 } catch ( err ) { }
260260}
0 commit comments