diff options
Diffstat (limited to 'client/src/app/shared/form-validators/host-validators.ts')
-rw-r--r-- | client/src/app/shared/form-validators/host-validators.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/src/app/shared/form-validators/host-validators.ts b/client/src/app/shared/form-validators/host-validators.ts index d750113ef..6f410a50a 100644 --- a/client/src/app/shared/form-validators/host-validators.ts +++ b/client/src/app/shared/form-validators/host-validators.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { AbstractControl, ValidatorFn, Validators } from '@angular/forms' | 1 | import { AbstractControl, ValidatorFn, Validators } from '@angular/forms' |
2 | import { BuildFormValidator } from './form-validator.model' | 2 | import { BuildFormValidator } from './form-validator.model' |
3 | 3 | ||
4 | function validateHost (value: string) { | 4 | export function validateHost (value: string) { |
5 | // Thanks to http://stackoverflow.com/a/106223 | 5 | // Thanks to http://stackoverflow.com/a/106223 |
6 | const HOST_REGEXP = new RegExp( | 6 | const HOST_REGEXP = new RegExp( |
7 | '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$' | 7 | '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$' |
@@ -10,7 +10,7 @@ function validateHost (value: string) { | |||
10 | return HOST_REGEXP.test(value) | 10 | return HOST_REGEXP.test(value) |
11 | } | 11 | } |
12 | 12 | ||
13 | function validateHandle (value: string) { | 13 | export function validateHandle (value: string) { |
14 | if (!value) return false | 14 | if (!value) return false |
15 | 15 | ||
16 | return value.includes('@') | 16 | return value.includes('@') |