mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
chore: enable noUncheckedIndexAccess (#7931)
This commit is contained in:
@@ -133,7 +133,7 @@ export class VoiceUDPSocket extends TypedEmitter<VoiceUDPSocketEvents> {
|
||||
const counter = buffer.readUInt32LE(0);
|
||||
const index = this.keepAlives.findIndex(({ value }) => value === counter);
|
||||
if (index === -1) return;
|
||||
this.ping = Date.now() - this.keepAlives[index].timestamp;
|
||||
this.ping = Date.now() - this.keepAlives[index]!.timestamp;
|
||||
// Delete all keep alives up to and including the received one
|
||||
this.keepAlives.splice(0, index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user