From d22c757c520e38f71ef0a303a3e116013555d01b Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 31 Aug 2023 18:44:58 -0400 Subject: [PATCH] fix: change approach to make socket optional --- src/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 04dae74..2deb75d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,8 @@ import { URL } from "url"; import { Buffer } from "buffer"; import { Readable } from "streamx"; +type OmitSocket = Omit; + export default class HyperTransportPeer extends BasePeer { private _peer: any; private _muxer: any; @@ -11,14 +13,16 @@ export default class HyperTransportPeer extends BasePeer { private _pipe?: any; constructor( - options: PeerConstructorOptions & { + options: OmitSocket & { peer: any; muxer: any; protocol: string; - socket?: any; }, ) { - super(options); + super({ + ...options, + socket: undefined, + }); const { peer, muxer, protocol } = options; this._peer = peer; this._muxer = muxer;