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);
ws.onpong = data => {
const promise = ws.__promises.get(data);
if (data) {
if (promise) {
ws.__promises.delete(data);
promise?.resolve();
}

View File

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