(
file: DeepnoteFile,
notebookIndex: number,
collectedOutputs: Map<string, { outputs: unknown[]; executionCount: number | null }>
)
| 38 | } |
| 39 | |
| 40 | export function serializeNotebookContext( |
| 41 | file: DeepnoteFile, |
| 42 | notebookIndex: number, |
| 43 | collectedOutputs: Map<string, { outputs: unknown[]; executionCount: number | null }> |
| 44 | ): string { |
| 45 | const notebook = file.project.notebooks[notebookIndex] |
| 46 | if (notebook == null) { |
| 47 | return 'Empty notebook.' |
| 48 | } |
| 49 | |
| 50 | const blocksWithAttachedOutputs = createBlocksWithAttachedOutputsFromCollectedOutputs({ |
| 51 | blocks: notebook.blocks, |
| 52 | collectedOutputs, |
| 53 | }) |
| 54 | return serializeNotebookContextFromBlocks({ |
| 55 | blocks: blocksWithAttachedOutputs, |
| 56 | notebookName: notebook.name, |
| 57 | }) |
| 58 | } |
| 59 | |
| 60 | export function createBlocksWithAttachedOutputsFromCollectedOutputs({ |
| 61 | blocks, |
no test coverage detected