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) => {
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 => {
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;

View file

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

View file

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

View file

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