MCPcopy Create free account
hub / github.com/anomalyco/models.dev / providerLogoSvg

Function providerLogoSvg

packages/web/src/render.tsx:1670–1690  ·  view source on GitHub ↗
(providerId: string)

Source from the content-addressed store, hash-verified

1668}
1669
1670function providerLogoSvg(providerId: string) {
1671 const cached = ProviderLogoSvgs.get(providerId);
1672 if (cached) return cached;
1673
1674 const logoPath = path.join(root, "providers", providerId, "logo.svg");
1675 const defaultLogoPath = path.join(root, "providers", "logo.svg");
1676 const rawSvg = readFileSync(
1677 existsSync(logoPath) ? logoPath : defaultLogoPath,
1678 "utf8",
1679 );
1680 const svg = rawSvg
1681 .replace(/<svg\b([^>]*)>/i, (_, attributes: string) => {
1682 const cleaned = attributes.replace(/\s(width|height)="[^"]*"/gi, "");
1683 return `<svg${cleaned} aria-hidden="true" focusable="false">`;
1684 })
1685 .replace(/\sfill="(?!none|currentColor)[^"]*"/gi, ' fill="currentColor"')
1686 .replace(/\sstroke="(?!none|currentColor)[^"]*"/gi, ' stroke="currentColor"');
1687
1688 ProviderLogoSvgs.set(providerId, svg);
1689 return svg;
1690}
1691
1692function labLogoSvg(labId: string) {
1693 const cached = LabLogoSvgs.get(labId);

Callers 1

ProviderLinkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected