*alias close to end
This commit is contained in:
parent
f89e2716f5
commit
3b7be7e892
|
@ -35,6 +35,7 @@ export default class Socket extends Duplex {
|
||||||
declare addEventListener: typeof this.addListener;
|
declare addEventListener: typeof this.addListener;
|
||||||
declare removeEventListener: typeof this.removeListener;
|
declare removeEventListener: typeof this.removeListener;
|
||||||
declare send: typeof this.write;
|
declare send: typeof this.write;
|
||||||
|
declare close: typeof this.end;
|
||||||
|
|
||||||
constructor({
|
constructor({
|
||||||
allowHalfOpen = false,
|
allowHalfOpen = false,
|
||||||
|
@ -64,6 +65,7 @@ export default class Socket extends Duplex {
|
||||||
this.addEventListener = this.addListener;
|
this.addEventListener = this.addListener;
|
||||||
this.removeEventListener = this.removeListener;
|
this.removeEventListener = this.removeListener;
|
||||||
this.send = this.write;
|
this.send = this.write;
|
||||||
|
this.close = this.end;
|
||||||
this.addEventListener("data", (data: any) =>
|
this.addEventListener("data", (data: any) =>
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.emit("message", new MessageEvent("data", { data }))
|
this.emit("message", new MessageEvent("data", { data }))
|
||||||
|
|
Loading…
Reference in New Issue