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";
44import { CONNECTION_CLOSED_ERROR_MSG } from "../utils" ;
55import AbstractConnector , { ErrorEmitter } from "./AbstractConnector" ;
66
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 > & {
911 disconnectTimeout ?: number ;
1012 tls ?: ConnectionOptions ;
1113} ;
@@ -19,13 +21,13 @@ export default class StandaloneConnector extends AbstractConnector {
1921 const { options } = this ;
2022 this . connecting = true ;
2123
22- let connectionOptions : TcpNetConnectOpts | IpcNetConnectOpts ;
24+ let connectionOptions : TcpOptions | IpcOptions ;
2325 if ( "path" in options && options . path ) {
2426 connectionOptions = {
2527 path : options . path ,
26- } as IpcNetConnectOpts ;
28+ } as IpcOptions ;
2729 } else {
28- connectionOptions = { } as TcpNetConnectOpts ;
30+ connectionOptions = { } as TcpOptions ;
2931 if ( "port" in options && options . port != null ) {
3032 connectionOptions . port = options . port ;
3133 }
You can’t perform that action at this time.
0 commit comments