(input: string)
| 61 | }; |
| 62 | |
| 63 | export 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 | } |
no outgoing calls
no test coverage detected