Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

webUrl.ts

8 lines190 Bytes

1export function isWebUrl(url: string): boolean {
2 try {
3 const { protocol } = new URL(url);
4 return protocol === "http:" || protocol === "https:";
5 } catch {
6 return false;
7 }
8}