From 40266cb99aa9fbc6cdcac4685061865424005f85 Mon Sep 17 00:00:00 2001 From: iCrawl Date: Sun, 4 Sep 2022 19:33:57 +0200 Subject: [PATCH] chore: deps --- package.json | 4 ++-- src/VoiceConnection.ts | 9 +++------ src/networking/Networking.ts | 1 - src/receive/VoiceReceiver.ts | 2 -- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index f42e85f4fbe2..aba04ab0fe66 100644 --- a/package.json +++ b/package.json @@ -69,8 +69,8 @@ "@types/node": "^16.11.56", "downlevel-dts": "^0.10.1", "eslint": "^8.23.0", - "eslint-config-neon": "^0.1.31", - "jest": "^29.0.1", + "eslint-config-neon": "^0.1.33", + "jest": "^29.0.2", "jest-websocket-mock": "^2.4.0", "mock-socket": "^9.1.5", "prettier": "^2.7.1", diff --git a/src/VoiceConnection.ts b/src/VoiceConnection.ts index 2dee81eefebc..85548f76d028 100644 --- a/src/VoiceConnection.ts +++ b/src/VoiceConnection.ts @@ -1,7 +1,4 @@ -/* eslint-disable consistent-return */ /* eslint-disable @typescript-eslint/unbound-method */ -/* eslint-disable jsdoc/check-param-names */ -/* eslint-disable @typescript-eslint/method-signature-style */ import type { Buffer } from 'node:buffer'; import { EventEmitter } from 'node:events'; import type { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from 'discord-api-types/v10'; @@ -244,10 +241,10 @@ export class VoiceConnection extends EventEmitter { * @param joinConfig - The data required to establish the voice connection * @param options - The options used to create this voice connection */ - public constructor(joinConfig: JoinConfig, { debug, adapterCreator }: CreateVoiceConnectionOptions) { + public constructor(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions) { super(); - this.debug = debug ? (message: string) => this.emit('debug', message) : null; + this.debug = options.debug ? (message: string) => this.emit('debug', message) : null; this.rejoinAttempts = 0; this.receiver = new VoiceReceiver(this); @@ -257,7 +254,7 @@ export class VoiceConnection extends EventEmitter { this.onNetworkingError = this.onNetworkingError.bind(this); this.onNetworkingDebug = this.onNetworkingDebug.bind(this); - const adapter = adapterCreator({ + const adapter = options.adapterCreator({ onVoiceServerUpdate: (data) => this.addServerPacket(data), onVoiceStateUpdate: (data) => this.addStatePacket(data), destroy: () => this.destroy(false), diff --git a/src/networking/Networking.ts b/src/networking/Networking.ts index 7390b6bd8e01..ec6214b946c2 100644 --- a/src/networking/Networking.ts +++ b/src/networking/Networking.ts @@ -489,7 +489,6 @@ export class Networking extends EventEmitter { const state = this.state; if (state.code !== NetworkingStatusCode.Ready) return; state.preparedPacket = this.createAudioPacket(opusPacket, state.connectionData); - // eslint-disable-next-line consistent-return return state.preparedPacket; } diff --git a/src/receive/VoiceReceiver.ts b/src/receive/VoiceReceiver.ts index 4657d7e07dcf..fee3a1db955e 100644 --- a/src/receive/VoiceReceiver.ts +++ b/src/receive/VoiceReceiver.ts @@ -101,7 +101,6 @@ export class VoiceReceiver { // Open packet const decrypted = methods.open(buffer.slice(12, end), nonce, secretKey); if (!decrypted) return; - // eslint-disable-next-line consistent-return return Buffer.from(decrypted); } @@ -124,7 +123,6 @@ export class VoiceReceiver { packet = packet.subarray(4 + 4 * headerExtensionLength); } - // eslint-disable-next-line consistent-return return packet; }