MCPcopy
hub / github.com/codeaashu/claude-code / parseDataUri

Function parseDataUri

src/tools/BashTool/utils.ts:59–65  ·  view source on GitHub ↗
(
  s: string,
)

Source from the content-addressed store, hash-verified

57 * Input is trimmed before matching.
58 */
59export function parseDataUri(
60 s: string,
61): { mediaType: string; data: string } | null {
62 const match = s.trim().match(DATA_URI_RE)
63 if (!match || !match[1] || !match[2]) return null
64 return { mediaType: match[1], data: match[2] }
65}
66
67/**
68 * Build an image tool_result block from shell stdout containing a data URI.

Callers 2

buildImageToolResultFunction · 0.85
resizeShellImageOutputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected