(block: DeepnoteBlock)
| 118 | } |
| 119 | |
| 120 | export function stripOutputsFromBlock(block: DeepnoteBlock): DeepnoteBlock { |
| 121 | if (!isExecutableBlockType(block.type)) { |
| 122 | return block |
| 123 | } |
| 124 | |
| 125 | // Create a copy without output fields (underscore prefix suppresses unused warnings) |
| 126 | const { |
| 127 | executionCount: _executionCount, |
| 128 | executionStartedAt: _executionStartedAt, |
| 129 | executionFinishedAt: _executionFinishedAt, |
| 130 | outputs: _outputs, |
| 131 | ...rest |
| 132 | } = block as DeepnoteBlock & { |
| 133 | executionCount?: number | null |
| 134 | executionStartedAt?: string |
| 135 | executionFinishedAt?: string |
| 136 | outputs?: unknown[] |
| 137 | } |
| 138 | |
| 139 | return rest as DeepnoteBlock |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * Splits a DeepnoteFile into a source file (no outputs) and a snapshot file (outputs only). |
nothing calls this directly
no test coverage detected