JavaScript-optional public web frontend for Bluesky anartia.kelinci.net
sveltekit atcute bluesky typescript svelte
at trunk 13 lines 247 B view raw
1export const safeUrlParse = (rawUrl: string): URL | null => { 2 const url = URL.parse(rawUrl); 3 if (!url) { 4 return null; 5 } 6 7 const protocol = url.protocol; 8 if (protocol !== 'https:' && protocol !== 'http:') { 9 return null; 10 } 11 12 return url; 13};