aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.com>2024-03-12 23:18:23 +0000
committerLeonardo Bishop <me@leonardobishop.com>2024-03-12 23:18:23 +0000
commita072c91cc0dc26e417c51f666e8547e08ef40942 (patch)
tree1a7296d2acb9038b1928cc1f0f5a08aa6b92b222 /lib
parenta4052ffee8bc7c6c8a69eba5120b5c6c2d951b0f (diff)
Add import from file system
Diffstat (limited to 'lib')
-rw-r--r--lib/util.ts30
1 files changed, 0 insertions, 30 deletions
diff --git a/lib/util.ts b/lib/util.ts
deleted file mode 100644
index 3a7e9aa..0000000
--- a/lib/util.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-const COLOR_CODE_REGEX = /&[0-9a-fk-or]/i;
-const VALID_ID_REGEX = /^[a-z0-9_]+$/i;
-
-export function stripColorCodes(str: string): string {
- return str.replace(COLOR_CODE_REGEX, '');
-}
-
-export function validateQuestId(id: string): boolean {
- return VALID_ID_REGEX.test(id);
-}
-
-export function validateCategoryId(id: string): boolean {
- return VALID_ID_REGEX.test(id);
-}
-
-export function validateTaskId(id: string): boolean {
- return VALID_ID_REGEX.test(id);
-}
-
-export function navigateToEditorPane(type: 'quest' | 'category' | null, id?: string) {
- if (id) {
- if (type === 'category') {
- navigateTo({ path: '/category/' + id })
- } else if (type === 'quest') {
- navigateTo({ path: '/quest/' + id })
- }
- } else if (!id && !type) {
- navigateTo({ path: '/' })
- }
-} \ No newline at end of file