(response: Response)
| 38 | } |
| 39 | |
| 40 | export async function readResponseAsDataURL(response: Response): Promise<string> { |
| 41 | const blob = await response.blob(); |
| 42 | const dataURL = await (new Promise<string>((resolve) => { |
| 43 | const reader = new FileReader(); |
| 44 | reader.onloadend = () => resolve(reader.result as string); |
| 45 | reader.readAsDataURL(blob); |
| 46 | })); |
| 47 | return dataURL; |
| 48 | } |
| 49 | |
| 50 | export async function loadAsText(url: string, mimeType?: string, origin?: string): Promise<string> { |
| 51 | const response = await getOKResponse(url, mimeType, origin); |
no outgoing calls
no test coverage detected