X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/5ecee04a6186627bd1875b2dabcc31489569ff71..f4012790be2404ce2f5b2594338fac43b1b9c59b:/src/validators/is-remote-host.tsx diff --git a/src/validators/is-remote-host.tsx b/src/validators/is-remote-host.tsx new file mode 100644 index 00000000..b5e22312 --- /dev/null +++ b/src/validators/is-remote-host.tsx @@ -0,0 +1,10 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + + +const ERROR_MESSAGE = 'Remote host is invalid'; + +export const isRemoteHost = (value: string) => { + return value.match(/\w+\.\w+\.\w+/i) ? undefined : ERROR_MESSAGE; +};