type function parameter

This commit is contained in:
fmtabbara
2021-08-04 12:42:25 +01:00
parent 3a9531b586
commit 518cd21fd6
+1 -3
View File
@@ -30,9 +30,7 @@ export const validateKey = (key: string): boolean => {
}
}
export const isValidHostname = (value) => {
if (typeof value !== 'string') return false
export const isValidHostname = (value: string) => {
const validHostnameChars = /^[a-zA-Z0-9-.]{1,253}\.?$/g
if (!validHostnameChars.test(value)) {
return false