Skip to main content
Glama
index.ts620 B
import { rasterizeSvg } from "./render" export type ImageData = { data: string mimeType: string } export const imageDataToBlob = async (image: ImageData): Promise<Blob> => { let { data, mimeType } = image if (mimeType === 'image/svg+xml') { const rasterized = await rasterizeSvg(data) data = rasterized.data mimeType = rasterized.mimeType } const buffer = Buffer.from(data, 'base64') return new Blob([buffer]) } export const nn = <T>(value: T | null | undefined): T => { if (value === null || value === undefined) { throw new Error("Value is null or undefined") } return value }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/recraft-ai/mcp-recraft-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server