*alias close to end

This commit is contained in:
Derrick Hammer 2023-02-25 22:48:57 -05:00
parent f89e2716f5
commit 3b7be7e892
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 0 deletions

View File

@ -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 }))