MCPcopy Create free account
hub / github.com/GrantCuster/gemini-spatial-example / parseBoundingBoxes

Function parseBoundingBoxes

src/utils.tsx:63–75  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

61};
62
63export function parseBoundingBoxes(input: string): ParsedResult[] {
64 const regex = /\[([^\]]+)\]\((\d+) (\d+) (\d+) (\d+)\)/g;
65 const results: ParsedResult[] = [];
66 let match;
67
68 while ((match = regex.exec(input)) !== null) {
69 const text = match[1];
70 const numbers = [parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5])] as [number, number, number, number];
71 results.push({ text, numbers });
72 }
73
74 return results;
75}

Callers 1

BoundingBoxOverlayFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected