File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,10 @@ import { NetStream } from "../types";
4
4
import { CONNECTION_CLOSED_ERROR_MSG } from "../utils" ;
5
5
import AbstractConnector , { ErrorEmitter } from "./AbstractConnector" ;
6
6
7
- export type StandaloneConnectionOptions = ( Partial < TcpNetConnectOpts > &
8
- Partial < IpcNetConnectOpts > ) & {
7
+ type TcpOptions = Pick < TcpNetConnectOpts , "port" | "host" | "family" > ;
8
+ type IpcOptions = Pick < IpcNetConnectOpts , "path" > ;
9
+
10
+ export type StandaloneConnectionOptions = Partial < TcpOptions & IpcOptions > & {
9
11
disconnectTimeout ?: number ;
10
12
tls ?: ConnectionOptions ;
11
13
} ;
@@ -19,13 +21,13 @@ export default class StandaloneConnector extends AbstractConnector {
19
21
const { options } = this ;
20
22
this . connecting = true ;
21
23
22
- let connectionOptions : TcpNetConnectOpts | IpcNetConnectOpts ;
24
+ let connectionOptions : TcpOptions | IpcOptions ;
23
25
if ( "path" in options && options . path ) {
24
26
connectionOptions = {
25
27
path : options . path ,
26
- } as IpcNetConnectOpts ;
28
+ } as IpcOptions ;
27
29
} else {
28
- connectionOptions = { } as TcpNetConnectOpts ;
30
+ connectionOptions = { } as TcpOptions ;
29
31
if ( "port" in options && options . port != null ) {
30
32
connectionOptions . port = options . port ;
31
33
}
You can’t perform that action at this time.
0 commit comments