From 3b7be7e8920e15e598d3fea74d2fff85cc38ea33 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 25 Feb 2023 22:48:57 -0500 Subject: [PATCH] *alias close to end --- src/socket.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/socket.ts b/src/socket.ts index 56c3fd8..839f698 100644 --- a/src/socket.ts +++ b/src/socket.ts @@ -35,6 +35,7 @@ export default class Socket extends Duplex { declare addEventListener: typeof this.addListener; declare removeEventListener: typeof this.removeListener; declare send: typeof this.write; + declare close: typeof this.end; constructor({ allowHalfOpen = false, @@ -64,6 +65,7 @@ export default class Socket extends Duplex { this.addEventListener = this.addListener; this.removeEventListener = this.removeListener; this.send = this.write; + this.close = this.end; this.addEventListener("data", (data: any) => // @ts-ignore this.emit("message", new MessageEvent("data", { data }))