Skip to content

Commit d8b9aca

Browse files
author
hywax
committed
chore: create helper check valid url
1 parent c812e2a commit d8b9aca

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

utils/validation.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export function isUrl(ur: string) {
2+
try {
3+
const _url = new URL(ur)
4+
return true
5+
} catch (_) {
6+
return false
7+
}
8+
}

0 commit comments

Comments
 (0)