Upgrade to typescript-eslint v6 (#25904)

This commit is contained in:
Renaud Chaput 2023-07-13 11:49:16 +02:00 committed by GitHub
parent 3ed9b55cb3
commit a7253075d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 133 additions and 107 deletions

View file

@ -38,7 +38,7 @@ export const soundsMiddleware = (): Middleware<
Record<string, never>,
RootState
> => {
const soundCache: { [key: string]: HTMLAudioElement } = {};
const soundCache: Record<string, HTMLAudioElement> = {};
void ready(() => {
soundCache.boop = createAudio([
@ -56,9 +56,9 @@ export const soundsMiddleware = (): Middleware<
return () =>
(next) =>
(action: AnyAction & { meta?: { sound?: string } }) => {
const sound = action?.meta?.sound;
const sound = action.meta?.sound;
if (sound && soundCache[sound]) {
if (sound && Object.hasOwn(soundCache, sound)) {
play(soundCache[sound]);
}