(output: NotebookCellOutput)
| 57 | } |
| 58 | |
| 59 | function processOutput(output: NotebookCellOutput) { |
| 60 | switch (output.output_type) { |
| 61 | case 'stream': |
| 62 | return { |
| 63 | output_type: output.output_type, |
| 64 | text: processOutputText(output.text), |
| 65 | } |
| 66 | case 'execute_result': |
| 67 | case 'display_data': |
| 68 | return { |
| 69 | output_type: output.output_type, |
| 70 | text: processOutputText(output.data?.['text/plain']), |
| 71 | image: output.data && extractImage(output.data), |
| 72 | } |
| 73 | case 'error': |
| 74 | return { |
| 75 | output_type: output.output_type, |
| 76 | text: processOutputText( |
| 77 | `${output.ename}: ${output.evalue}\n${output.traceback.join('\n')}`, |
| 78 | ), |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | function processCell( |
| 84 | cell: NotebookCell, |
nothing calls this directly
no test coverage detected