File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import * as net from "net";
33import cosmosDBServer from "." ;
44
55const argv = process . argv . slice ( 2 ) ;
6- const args : { help ?: boolean ; port ? : number , hostname ? : string } = { } ;
6+ const args : { help ?: boolean ; port ? : number ; hostname ? : string } = { } ;
77while ( argv . length ) {
88 const key = argv . shift ( ) ;
99 switch ( key ) {
@@ -39,11 +39,12 @@ Options:
3939
4040const server = cosmosDBServer ( ) . listen ( args . port , args . hostname , ( ) => {
4141 const { address, family, port } = server . address ( ) as net . AddressInfo ;
42- const hostname = args . hostname ? args . hostname : (
43- family === "IPv6" ? `[${ address } ]` : address
44- ) ;
42+ // eslint-disable-next-line no-nested-ternary
43+ const hostname = args . hostname
44+ ? args . hostname
45+ : family === "IPv6"
46+ ? `[${ address } ]`
47+ : address ;
4548 // eslint-disable-next-line no-console
46- console . log (
47- `Ready to accept connections at ${ hostname } :${ port } `
48- ) ;
49+ console . log ( `Ready to accept connections at ${ hostname } :${ port } ` ) ;
4950} ) ;
Original file line number Diff line number Diff line change @@ -78,8 +78,8 @@ export default (opts?: ServerOptions) => {
7878 } ) . on ( "listening" , ( ) => {
7979 const address = server . address ( ) ;
8080 if ( typeof address === "object" && address ) {
81- const { address :host , port } = address as net . AddressInfo ;
82- const hostname = ( host == ' 0.0.0.0' || host == '::' ) ? ' localhost' : host ;
81+ const { address : host , port } = address as net . AddressInfo ;
82+ const hostname = host === " 0.0.0.0" || host === "::" ? " localhost" : host ;
8383
8484 account = new Account ( hostname , port ) ;
8585 } else {
You can’t perform that action at this time.
0 commit comments