UNPKG

@tanstack/ai

Version:

Core TanStack AI library - Open source AI SDK

21 lines (20 loc) 440 B
function detectImageMimeType(base64Data) { const prefix = base64Data.substring(0, 20); if (prefix.startsWith("/9j/")) { return "image/jpeg"; } if (prefix.startsWith("iVBORw0KGgo")) { return "image/png"; } if (prefix.startsWith("R0lGOD")) { return "image/gif"; } if (prefix.startsWith("UklGR")) { return "image/webp"; } return void 0; } export { detectImageMimeType }; //# sourceMappingURL=utils.js.map