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

Function loadLatestSnapshot

packages/convert/src/snapshot/lookup.ts:151–166  ·  view source on GitHub ↗
(
  sourceFilePath: string,
  projectId: string,
  options: SnapshotOptions = {}
)

Source from the content-addressed store, hash-verified

149 * @returns The parsed DeepnoteSnapshot or null if not found
150 */
151export async function loadLatestSnapshot(
152 sourceFilePath: string,
153 projectId: string,
154 options: SnapshotOptions = {}
155): Promise<DeepnoteSnapshot | null> {
156 const projectDir = dirname(sourceFilePath)
157 const snapshots = await findSnapshotsForProject(projectDir, projectId, options)
158
159 if (snapshots.length === 0) {
160 return null
161 }
162
163 // Load the first (most recent) snapshot
164 const snapshotInfo = snapshots[0]
165 return loadSnapshotFile(snapshotInfo.path)
166}
167
168/**
169 * Loads and parses a snapshot file.

Callers 5

convertDeepnoteToFormatFunction · 0.90
lookup.test.tsFile · 0.90
handleSnapshotLoadFunction · 0.90
handleSnapshotMergeFunction · 0.90

Calls 2

findSnapshotsForProjectFunction · 0.85
loadSnapshotFileFunction · 0.85

Tested by

no test coverage detected