Function
isLargeOutputs
(
outputs: (NotebookCellSourceOutput | undefined)[],
)
Source from the content-addressed store, hash-verified
| 20 | const LARGE_OUTPUT_THRESHOLD = 10000 |
| 21 | |
| 22 | function isLargeOutputs( |
| 23 | outputs: (NotebookCellSourceOutput | undefined)[], |
| 24 | ): boolean { |
| 25 | let size = 0 |
| 26 | for (const o of outputs) { |
| 27 | if (!o) continue |
| 28 | size += (o.text?.length ?? 0) + (o.image?.image_data.length ?? 0) |
| 29 | if (size > LARGE_OUTPUT_THRESHOLD) return true |
| 30 | } |
| 31 | return false |
| 32 | } |
| 33 | |
| 34 | function processOutputText(text: string | string[] | undefined): string { |
| 35 | if (!text) return '' |
Tested by
no test coverage detected