Fix linting errors

This commit is contained in:
2024-07-14 21:07:51 +02:00
parent c57cd03407
commit 1c9f95cebc
8 changed files with 34 additions and 29 deletions

View File

@ -3,11 +3,11 @@ import { matches } from './match';
export const Hosters = {
getDisabled: async () => {
const disabled = await storageGet<string[]>('hosters.disabled', []);
const disabled = (await storageGet('hosters.disabled', [])) as string[];
return disabled.map((id) => matches[id]).filter((m) => m !== undefined);
},
disable: async (match: Match) => {
const disabled = await storageGet('hosters.disabled', []);
const disabled = (await storageGet('hosters.disabled', [])) as string[];
const index = disabled.indexOf(match.id);
if (index === -1) {
disabled.push(match.id);
@ -15,7 +15,7 @@ export const Hosters = {
}
},
enable: async (match: Match) => {
const disabled = await storageGet('hosters.disabled', []);
const disabled = (await storageGet('hosters.disabled', [])) as string[];
const index = disabled.indexOf(match.id);
if (index !== -1) {
disabled.splice(index, 1);
@ -35,7 +35,7 @@ export const Hosters = {
export const Redirect = {
get: async (): Promise<Match | null> => {
return matches[await storageGet<string>('redirect')] || null;
return matches[(await storageGet('redirect')) as string] || null;
},
set: async (match: Match) => {
await storageSet('redirect', match.id);