(contentType: string)
| 477 | } |
| 478 | |
| 479 | function 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 | |
| 485 | async function bufferFromImageUrl(url: string): Promise<{ buffer: Buffer; contentType: string }> { |
| 486 | if (url.startsWith('data:')) { |
no outgoing calls
no test coverage detected