From c9aefa81ca1950121d2357fc66afe15eb400f537 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Fri, 15 Mar 2024 00:13:40 +0000 Subject: Fix eslint errors --- utils/util.ts | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'utils/util.ts') diff --git a/utils/util.ts b/utils/util.ts index 273191a..f5f7247 100644 --- a/utils/util.ts +++ b/utils/util.ts @@ -1,31 +1,34 @@ -const COLOR_CODE_REGEX = /&([0-9a-fk-or]|#[0-9A-F]{6})/ig; +const COLOR_CODE_REGEX = /&([0-9a-fk-or]|#[0-9A-F]{6})/gi; export function stripColorCodes(str: string): string { return str.replace(COLOR_CODE_REGEX, ''); } -export function navigateToEditorPane(type: 'quest' | 'category' | 'item' | 'config' | null, id?: string) { +export function navigateToEditorPane( + type: 'quest' | 'category' | 'item' | 'config' | null, + id?: string +) { if (id) { if (type === 'category') { - navigateTo({ path: '/editor/category/' + id }) + navigateTo({ path: '/editor/category/' + id }); } else if (type === 'quest') { - navigateTo({ path: '/editor/quest/' + id }) + navigateTo({ path: '/editor/quest/' + id }); } else if (type === 'item') { - navigateTo({ path: '/editor/item/' + id }) + navigateTo({ path: '/editor/item/' + id }); } } else if (type === 'config') { - navigateTo({ path: '/editor/config' }) + navigateTo({ path: '/editor/config' }); } else if (!id && !type) { - navigateTo({ path: '/editor' }) + navigateTo({ path: '/editor' }); } } export type BrowserCapabilities = { - canUseFsApi: boolean -} + canUseFsApi: boolean; +}; export function getBrowserCapabilities(): BrowserCapabilities { return { - canUseFsApi: typeof (window as any)?.showDirectoryPicker === 'function' - } -} \ No newline at end of file + canUseFsApi: typeof (window as any)?.showDirectoryPicker === 'function', + }; +} -- cgit v1.2.3-70-g09d2