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

Function transform

apps/api/src/utils/parseUrlMeta.ts:50–58  ·  view source on GitHub ↗
(data: UrlMetaData, url: string)

Source from the content-addressed store, hash-verified

48}
49
50function transform(data: UrlMetaData, url: string) {
51 const favicon = findBestFavicon(data.favicons);
52 const ogImage = findBestOgImage(data);
53
54 return {
55 favicon: favicon ? new URL(favicon, url).toString() : fallbackFavicon(url),
56 ogImage: ogImage ? new URL(ogImage, url).toString() : null,
57 };
58}
59
60interface UrlMetaData {
61 favicons: {

Callers 1

parseUrlMetaFunction · 0.70

Calls 4

findBestFaviconFunction · 0.85
findBestOgImageFunction · 0.85
fallbackFaviconFunction · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected