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

Function getSnapshotPath

packages/convert/src/snapshot/lookup.ts:204–211  ·  view source on GitHub ↗
(sourcePath: string, file: DeepnoteFile, options: GetSnapshotPathOptions = {})

Source from the content-addressed store, hash-verified

202 * @returns Absolute path to the snapshot file
203 */
204export function getSnapshotPath(sourcePath: string, file: DeepnoteFile, options: GetSnapshotPathOptions = {}): string {
205 const { projectName, timestamp = 'latest', snapshotDir } = options
206 const dir = getSnapshotDir(sourcePath, snapshotDir !== undefined ? { snapshotDir } : {})
207 const slug = slugifyProjectName(projectName ?? file.project.name) || 'project'
208 const notebookId = resolveSnapshotNotebookId(file)
209 const filename = generateSnapshotFilename({ slug, projectId: file.project.id, notebookId, timestamp })
210 return resolve(dir, filename)
211}
212
213/**
214 * Checks if a snapshot exists for a project.

Callers 4

writeDeepnoteFileFunction · 0.90
lookup.test.tsFile · 0.90
saveExecutionSnapshotFunction · 0.90
handleSnapshotSplitFunction · 0.90

Calls 4

slugifyProjectNameFunction · 0.90
generateSnapshotFilenameFunction · 0.90
getSnapshotDirFunction · 0.85

Tested by

no test coverage detected