Skip to content

Commit

Permalink
feat:valid func
Browse files Browse the repository at this point in the history
  • Loading branch information
Chulinuwu committed Dec 25, 2024
1 parent 5ac34cd commit a757849
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/utils/urlvalid.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export function isValidURL(url: string): boolean {
const urlPattern = /^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/;
return urlPattern.test(url);
}

0 comments on commit a757849

Please sign in to comment.