This commit is contained in:
Janis
2023-01-22 17:04:42 +01:00
parent bead72cde7
commit 2c0207dc65
21 changed files with 338 additions and 93 deletions

10
validators.ts Normal file
View File

@@ -0,0 +1,10 @@
export function isValidText(text: string): boolean {
const textRegex = /^[a-zA-Z\s\d\-_\(\)\[\]\{\}\!\@\#\$\%\^\&\*\+\=\,\.\?\/\\\|\'\":;]+$/;
return textRegex.test(text) && text.length > 0;
}
export function isValidName(name: string): boolean {
const nameRegex = /^[a-zA-Z0-9\-_]+$/;
return nameRegex.test(name);
}