MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / fallbackFavicon

Function fallbackFavicon

apps/api/src/utils/parseUrlMeta.ts:3–11  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

1import urlMetadata from 'url-metadata';
2
3function fallbackFavicon(url: string) {
4 try {
5 const hostname = new URL(url).hostname;
6 return `https://icons.duckduckgo.com/ip3/${hostname}.ico`;
7 } catch {
8 // If URL parsing fails, use the original string
9 return `https://icons.duckduckgo.com/ip3/${url}.ico`;
10 }
11}
12
13function findBestFavicon(favicons: UrlMetaData['favicons']) {
14 const match = favicons

Callers 2

transformFunction · 0.85
parseUrlMetaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected