mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
chore: enable noUncheckedIndexAccess (#7931)
This commit is contained in:
@@ -185,7 +185,7 @@ export class Collection<K, V> extends Map<K, V> {
|
||||
if (!arr.length || !amount) return [];
|
||||
return Array.from(
|
||||
{ length: Math.min(amount, arr.length) },
|
||||
(): V => arr.splice(Math.floor(Math.random() * arr.length), 1)[0],
|
||||
(): V => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]!,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ export class Collection<K, V> extends Map<K, V> {
|
||||
if (!arr.length || !amount) return [];
|
||||
return Array.from(
|
||||
{ length: Math.min(amount, arr.length) },
|
||||
(): K => arr.splice(Math.floor(Math.random() * arr.length), 1)[0],
|
||||
(): K => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]!,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user