2
0

🚸 (results) Add progress bar to export results modal

This commit is contained in:
Baptiste Arnaud
2024-01-11 10:36:48 +01:00
parent 03258e0f64
commit 5d971f7b6f
8 changed files with 62 additions and 34 deletions

View File

@ -1,8 +1,4 @@
export const validateUrl = (url: string) => {
try {
new URL(url)
return true
} catch (_) {
return false
}
}
const urlRegex =
/^(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})$/
export const validateUrl = (url: string) => urlRegex.test(url)