(file: DeepnoteFile)
| 99 | * @returns Number of blocks that have outputs |
| 100 | */ |
| 101 | export function countBlocksWithOutputs(file: DeepnoteFile): number { |
| 102 | let count = 0 |
| 103 | for (const notebook of file.project.notebooks) { |
| 104 | for (const block of notebook.blocks) { |
| 105 | const execBlock = block as DeepnoteBlock & { outputs?: unknown[] } |
| 106 | if (execBlock.outputs && execBlock.outputs.length > 0) { |
| 107 | count++ |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | return count |
| 112 | } |