MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / translateStreamOutput

Function translateStreamOutput

src/kernels/execution/helpers.ts:286–295  ·  view source on GitHub ↗
(
    output: nbformat.IStream,
    cellIndex?: number,
    cellId?: string,
    cellMetadata?: Record<string, unknown>
)

Source from the content-addressed store, hash-verified

284}
285
286function translateStreamOutput(
287 output: nbformat.IStream,
288 cellIndex?: number,
289 cellId?: string,
290 cellMetadata?: Record<string, unknown>
291): NotebookCellOutput {
292 const value = concatMultilineString(output.text);
293 const factoryFn = output.name === 'stderr' ? NotebookCellOutputItem.stderr : NotebookCellOutputItem.stdout;
294 return new NotebookCellOutput([factoryFn(value)], getOutputMetadata(output, cellIndex, cellId, cellMetadata));
295}
296
297// Output stream can only have stderr or stdout so just check the first output. Undefined if no outputs
298function getOutputStreamType(output: NotebookCellOutput): string | undefined {

Callers

nothing calls this directly

Calls 2

concatMultilineStringFunction · 0.90
getOutputMetadataFunction · 0.85

Tested by

no test coverage detected