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,14 +59,14 @@ 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;
/**