MCPcopy Index your code
hub / github.com/deepnote/deepnote / stripOutputsFromBlock

Function stripOutputsFromBlock

packages/convert/src/snapshot/split.ts:120–140  ·  view source on GitHub ↗
(block: DeepnoteBlock)

Source from the content-addressed store, hash-verified

118}
119
120export 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).

Callers

nothing calls this directly

Calls 1

isExecutableBlockTypeFunction · 0.90

Tested by

no test coverage detected