MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / parseDataUrl

Function parseDataUrl

ai/ai.ts:621–627  ·  view source on GitHub ↗
(
  url: string,
)

Source from the content-addressed store, hash-verified

619
620const parseDataUrl = (
621 url: string,
622): { mimeType: string; data: Buffer } | null => {
623 const match = url.match(/^data:([^;]+);base64,(.+)$/);
624 if (!match) return null;
625 return { mimeType: match[1], data: Buffer.from(match[2], "base64") };
626};
627
628const normalizeDownloadedMedia = async (
629 downloaded: any,
630): Promise<Buffer | null> => {

Callers 6

resolveImageInputsFunction · 0.85
parseContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected