MCPcopy Index your code
hub / github.com/simstudioai/sim / extensionFromContentType

Function extensionFromContentType

apps/sim/app/api/tools/image/route.ts:479–483  ·  view source on GitHub ↗
(contentType: string)

Source from the content-addressed store, hash-verified

477}
478
479function extensionFromContentType(contentType: string): string {
480 if (contentType.includes('jpeg') || contentType.includes('jpg')) return 'jpg'
481 if (contentType.includes('webp')) return 'webp'
482 return 'png'
483}
484
485async function bufferFromImageUrl(url: string): Promise<{ buffer: Buffer; contentType: string }> {
486 if (url.startsWith('data:')) {

Callers 3

generateWithOpenAIFunction · 0.85
generateWithGeminiFunction · 0.85
generateWithFalAIFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected