MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / stripBase64Images

Function stripBase64Images

src/tools/web/extract-select.ts:52–54  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

50 * or vision-analyze them. Mirrors Hermes's convert_base64_images_to_links. PURE.
51 */
52export function stripBase64Images(text: string): string {
53 return text.replace(/!\[([^\]]*)\]\(\s*data:image\/[^;]+;base64,[^)]*\)/gi, (_m, alt) => `[IMAGE${alt ? `: ${String(alt).trim()}` : ''}]`);
54}
55
56/** Hermes's positional fallback: a head+tail window (~75/25), snapped to line boundaries. PURE. */
57export function headTailWindow(text: string, budget: number): { content: string; keptChars: number } {

Callers 3

executeMethod · 0.85
capMarkdownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected