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

projectFavicon.ts

12 lines393 Bytes

1export const PROJECT_FAVICON_FALLBACK_MARKER = "project-favicon-missing";
2​
3export function isProjectFaviconFallbackUrl(url: string | null | undefined): boolean {
4 if (!url) return false;
5​
6 try {
7 const pathname = new URL(url, "https://t3.invalid").pathname;
8 return pathname.slice(pathname.lastIndexOf("/") + 1) === PROJECT_FAVICON_FALLBACK_MARKER;
9 } catch {
10 return false;
11 }