(bytes: Uint8Array)
| 71 | node.fills instanceof Array && node.fills.length > 1; |
| 72 | |
| 73 | const imageBytesToBase64 = (bytes: Uint8Array): string => { |
| 74 | // Convert Uint8Array to binary string |
| 75 | const binaryString = bytes.reduce((data, byte) => { |
| 76 | return data + String.fromCharCode(byte); |
| 77 | }, ""); |
| 78 | |
| 79 | // Encode binary string to base64 |
| 80 | const b64 = btoa(binaryString); |
| 81 | |
| 82 | return `data:image/png;base64,${b64}`; |
| 83 | }; |
| 84 | |
| 85 | export const exportNodeAsBase64PNG = async <T extends ExportableNode>( |
| 86 | node: AltNode<T>, |
no outgoing calls
no test coverage detected