From af7fd04a6706fb781e4622167b08dc6c9376f06a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 29 Jul 2021 15:19:22 +0200 Subject: Add ability to filter by host in search page --- client/src/app/shared/form-validators/host-validators.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/src/app/shared/form-validators') 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 @@ import { AbstractControl, ValidatorFn, Validators } from '@angular/forms' import { BuildFormValidator } from './form-validator.model' -function validateHost (value: string) { +export function validateHost (value: string) { // Thanks to http://stackoverflow.com/a/106223 const HOST_REGEXP = new RegExp( '^(([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) { return HOST_REGEXP.test(value) } -function validateHandle (value: string) { +export function validateHandle (value: string) { if (!value) return false return value.includes('@') -- cgit v1.2.3