(svg: string)
| 182 | } |
| 183 | |
| 184 | function viewBox(svg: string): { width: number; height: number } { |
| 185 | const box = /viewBox="0 0 (\d+(?:\.\d+)?) (\d+(?:\.\d+)?)"/.exec(svg); |
| 186 | expect(box, 'no viewBox').toBeTruthy(); |
| 187 | return { width: Number(box![1]), height: Number(box![2]) }; |
| 188 | } |
| 189 | |
| 190 | function rootSize(svg: string): { width: number; height: number } { |
| 191 | const w = /<svg[^>]*\bwidth="(\d+)"/.exec(svg); |
no test coverage detected