diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 14:32:15 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 14:32:15 +0200 |
commit | df98563e2104b82b119c00a3cd83cd0dc1242d25 (patch) | |
tree | a9720bf01bac9ad5646bd3d3c9bc7653617afdad /client/src/app/shared/forms/form-validators/host.validator.ts | |
parent | 46757b477c1adb5f98060d15998a3852e18902a6 (diff) | |
download | PeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.tar.gz PeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.tar.zst PeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.zip |
Use typescript standard and lint all files
Diffstat (limited to 'client/src/app/shared/forms/form-validators/host.validator.ts')
-rw-r--r-- | client/src/app/shared/forms/form-validators/host.validator.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/client/src/app/shared/forms/form-validators/host.validator.ts b/client/src/app/shared/forms/form-validators/host.validator.ts index ec417e079..03e810fdb 100644 --- a/client/src/app/shared/forms/form-validators/host.validator.ts +++ b/client/src/app/shared/forms/form-validators/host.validator.ts | |||
@@ -1,14 +1,14 @@ | |||
1 | import { FormControl } from '@angular/forms'; | 1 | import { FormControl } from '@angular/forms' |
2 | 2 | ||
3 | export function validateHost(c: FormControl) { | 3 | export function validateHost (c: FormControl) { |
4 | // Thanks to http://stackoverflow.com/a/106223 | 4 | // Thanks to http://stackoverflow.com/a/106223 |
5 | const HOST_REGEXP = new RegExp( | 5 | const HOST_REGEXP = new RegExp( |
6 | '^(([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])$' | 6 | '^(([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 | ); | 7 | ) |
8 | 8 | ||
9 | return HOST_REGEXP.test(c.value) ? null : { | 9 | return HOST_REGEXP.test(c.value) ? null : { |
10 | validateHost: { | 10 | validateHost: { |
11 | valid: false | 11 | valid: false |
12 | } | 12 | } |
13 | }; | 13 | } |
14 | } | 14 | } |