fix code quality issues

This commit is contained in:
まっちゃとーにゅ 2024-01-14 02:46:58 +09:00
parent c5a86174a7
commit 5b0afc9a98
No known key found for this signature in database
GPG Key ID: 6AFBBF529601C1DB
4 changed files with 9 additions and 10 deletions

View File

@ -59,12 +59,12 @@ export default function(props: MfmProps, context: SetupContext<MfmEvents>) {
const validTime = (t: string | null | undefined) => { const validTime = (t: string | null | undefined) => {
if (t == null) return null; if (t == null) return null;
return t.match(/^[0-9.]+s$/) ? t : null; return RegExp(/^[0-9.]+s$/).exec(t) ? t : null;
}; };
const validColor = (c: string | null | undefined): string | null => { const validColor = (c: string | null | undefined): string | null => {
if (c == null) return null; if (c == null) return null;
return c.match(/^[0-9a-f]{3,6}$/i) ? c : null; return RegExp(/^[0-9a-f]{3,6}$/i).exec(c) ? c : null;
}; };
const useAnim = defaultStore.state.advancedMfm && defaultStore.state.animatedMfm; const useAnim = defaultStore.state.advancedMfm && defaultStore.state.animatedMfm;

View File

@ -1003,10 +1003,10 @@ function attachGameEvents() {
}); });
} }
} }
} else { //} else {
if (!props.mute) { // if (!props.mute) {
// TODO: // // TODO:
} // }
} }
}); });

View File

@ -530,6 +530,7 @@ export class DropAndFusionGame extends EventEmitter<{
case 'yen': return YEN_MONOS; case 'yen': return YEN_MONOS;
case 'square': return SQUARE_MONOS; case 'square': return SQUARE_MONOS;
case 'sweets': return SWEETS_MONOS; case 'sweets': return SWEETS_MONOS;
default: throw new Error('unknown game mode');
} }
} }
@ -743,7 +744,6 @@ export class DropAndFusionGame extends EventEmitter<{
this.gameOver(); this.gameOver();
break; break;
} }
continue;
} }
} }
} }

View File

@ -26,7 +26,6 @@ function main() {
if (!result.success) { if (!result.success) {
abort(result.message); abort(result.message);
return;
} }
} }