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

Function buildBlockMap

packages/cli/src/utils/analysis.ts:800–820  ·  view source on GitHub ↗
(file: DeepnoteFile, options: AnalysisOptions = {})

Source from the content-addressed store, hash-verified

798 * Build a block map from a DeepnoteFile for use with diagnosis functions.
799 */
800export function buildBlockMap(file: DeepnoteFile, options: AnalysisOptions = {}): Map<string, BlockInfo> {
801 const blockMap = new Map<string, BlockInfo>()
802
803 for (const notebook of file.project.notebooks) {
804 if (options.notebook && notebook.name !== options.notebook) {
805 continue
806 }
807
808 for (const block of notebook.blocks) {
809 blockMap.set(block.id, {
810 id: block.id,
811 label: getBlockLabel(block),
812 type: block.type,
813 notebookName: notebook.name,
814 sortingKey: block.sortingKey,
815 })
816 }
817 }
818
819 return blockMap
820}

Callers 3

analysis.test.tsFile · 0.90
buildMachineRunResultFunction · 0.90
analyzeFileFunction · 0.90

Calls 1

getBlockLabelFunction · 0.90

Tested by

no test coverage detected