4001 add validation for blocklist (#5172)

Closes #4001
This commit is contained in:
bosiraphael
2024-04-25 15:32:55 +02:00
committed by GitHub
parent 4af2c5f298
commit d23e02adca
8 changed files with 148 additions and 32 deletions

View File

@ -0,0 +1,5 @@
export const isDomain = (url: string | undefined | null) =>
!!url &&
/^((?!-))(xn--)?[a-z0-9][a-z0-9-_]{0,61}[a-z0-9]{0,1}\.(xn--)?([a-z0-9-]{1,61}|[a-z0-9-]{1,30}\.[a-z]{2,})$/.test(
url,
);