diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2024-03-12 23:18:23 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2024-03-12 23:18:23 +0000 |
| commit | a072c91cc0dc26e417c51f666e8547e08ef40942 (patch) | |
| tree | 1a7296d2acb9038b1928cc1f0f5a08aa6b92b222 /utils/validators.ts | |
| parent | a4052ffee8bc7c6c8a69eba5120b5c6c2d951b0f (diff) | |
Add import from file system
Diffstat (limited to 'utils/validators.ts')
| -rw-r--r-- | utils/validators.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/utils/validators.ts b/utils/validators.ts new file mode 100644 index 0000000..5bf259a --- /dev/null +++ b/utils/validators.ts @@ -0,0 +1,13 @@ +const VALID_ID_REGEX = /^[a-z0-9_]+$/i; + +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); +} |
