Skip to content

Commit

Permalink
feat: add toString method to Listener
Browse files Browse the repository at this point in the history
  • Loading branch information
antho-bunny committed Aug 28, 2024
1 parent 99ea60e commit 88318ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-tips-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bunny.net/edgescript-sdk": minor
---

Add a toString method to TCP Listener
7 changes: 7 additions & 0 deletions libs/bunny-sdk/src/net/tcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ export function unstable_local_addr(tcp: TcpListener): SocketAddr.SocketAddr {
return tcp.addr;
}

/**
* Format the associated [TcpListener] to a String
*/
export function toString(tcp: TcpListener): string {
return `${SocketAddr.ip(tcp.addr)}:${SocketAddr.port(tcp.addr)}`;
}

/**
* Create a new [TcpListener].
*/
Expand Down

0 comments on commit 88318ed

Please sign in to comment.