chore: enable noUncheckedIndexAccess (#7931)

This commit is contained in:
DD
2022-05-18 20:56:42 +03:00
committed by GitHub
parent 993eb74475
commit e2f5a4a494
6 changed files with 7 additions and 6 deletions

View File

@@ -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]!,
);
}