(base64: string)
| 319 | }; |
| 320 | |
| 321 | const bytesFromBase64 = (base64: string): Uint8Array => { |
| 322 | const binary = atob(base64); |
| 323 | const bytes = new Uint8Array(binary.length); |
| 324 | for (let index = 0; index < binary.length; index += 1) { |
| 325 | bytes[index] = binary.charCodeAt(index); |
| 326 | } |
| 327 | return bytes; |
| 328 | }; |
| 329 | |
| 330 | const decodeTextFile = (file: ToolFileValue): string => { |
| 331 | const text = new TextDecoder("utf-8", { fatal: false }).decode(bytesFromBase64(file.data)); |