From fbffb1da72f55567af45420dc54abe230ff8b062 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 31 Aug 2023 02:25:27 -0400 Subject: [PATCH] fix: need a getter for id --- src/peer/tcp.ts | 4 ++++ src/peer/webSocket.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/peer/tcp.ts b/src/peer/tcp.ts index fb14ca1..62f9b0e 100644 --- a/src/peer/tcp.ts +++ b/src/peer/tcp.ts @@ -18,6 +18,10 @@ export class TcpPeer implements Peer { private _id?: NodeId; + get id(): NodeId { + return this._id as NodeId; + } + set id(value: NodeId) { this._id = value; } diff --git a/src/peer/webSocket.ts b/src/peer/webSocket.ts index b85c043..4474e26 100644 --- a/src/peer/webSocket.ts +++ b/src/peer/webSocket.ts @@ -16,6 +16,10 @@ export class WebSocketPeer implements Peer { private _id?: NodeId; + get id(): NodeId { + return this._id as NodeId; + } + set id(value: NodeId) { this._id = value; }