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

Function isDirectImage

apps/api/src/controllers/misc.controller.ts:224–230  ·  view source on GitHub ↗
(url: URL)

Source from the content-addressed store, hash-verified

222
223// Check if URL is a direct image
224function isDirectImage(url: URL): boolean {
225 const imageExtensions = ['svg', 'png', 'jpg', 'jpeg', 'gif', 'webp', 'ico'];
226 return (
227 imageExtensions.some((ext) => url.pathname.endsWith(`.${ext}`)) ||
228 url.toString().includes('googleusercontent.com')
229 );
230}
231
232export async function getFavicon(
233 request: FastifyRequest<{

Callers 2

getFaviconFunction · 0.85
getOgImageFunction · 0.85

Calls 2

someMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected