fix: unused properties

This commit is contained in:
MARCROCK22 2024-08-03 00:06:44 +00:00
parent 966a157547
commit 2c69e1cb41
2 changed files with 2 additions and 7 deletions

View File

@ -14,7 +14,7 @@ export class BaseSocket {
this.ping = ws.waitPing.bind(ws); this.ping = ws.waitPing.bind(ws);
ws.onpong = data => { ws.onpong = data => {
const promise = ws.__promises.get(data); const promise = ws.__promises.get(data);
if (data) { if (promise) {
ws.__promises.delete(data); ws.__promises.delete(data);
promise?.resolve(); promise?.resolve();
} }

View File

@ -1,7 +1,7 @@
import { randomBytes, createHash, randomUUID } from 'node:crypto'; import { randomBytes, createHash, randomUUID } from 'node:crypto';
import { request } from 'node:https'; import { request } from 'node:https';
import type { Socket } from 'node:net'; import type { Socket } from 'node:net';
import { createInflate, inflateSync } from 'node:zlib'; import { inflateSync } from 'node:zlib';
export class SeyfertWebSocket { export class SeyfertWebSocket {
socket?: Socket = undefined; socket?: Socket = undefined;
@ -9,7 +9,6 @@ export class SeyfertWebSocket {
path: string; path: string;
__stored: Buffer[] = []; __stored: Buffer[] = [];
__opcode = 0; __opcode = 0;
__body: Buffer[] = [];
__promises = new Map< __promises = new Map<
string, string,
{ {
@ -17,7 +16,6 @@ export class SeyfertWebSocket {
reject: (reason?: any) => void; reject: (reason?: any) => void;
} }
>(); >();
__zlib?: ReturnType<typeof createInflate>;
constructor( constructor(
url: string, url: string,
@ -26,9 +24,6 @@ export class SeyfertWebSocket {
const urlParts = new URL(url); const urlParts = new URL(url);
this.hostname = urlParts.hostname || ''; this.hostname = urlParts.hostname || '';
this.path = `${urlParts.pathname}${urlParts.search || ''}&encoding=json`; this.path = `${urlParts.pathname}${urlParts.search || ''}&encoding=json`;
if (compress) {
this.__zlib = createInflate();
}
this.connect(); this.connect();
} }