Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
fix: make it even more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Dec 6, 2023
1 parent 9dff59c commit 1af3d0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ export const isUrlValid = (str?: string | null): boolean => {
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
'((\\d{1,3}\\.){3}\\d{1,3})|' + // OR ip (v4) address
'localhost)' + // OR localhost alias
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
'(\\?\\S*)?' + // query string
'(\\:\\d+)?' + // post (optional)
'(\\/\\S*?)*' + // path (lazy: takes as few as possible)
'(\\?\\S*?)?' + // query string (lazy)
'(\\#\\S*)?$', // fragment locator
'i',
);
Expand Down

0 comments on commit 1af3d0f

Please sign in to comment.