(sourcePath: string, file: DeepnoteFile, options: GetSnapshotPathOptions = {})
| 202 | * @returns Absolute path to the snapshot file |
| 203 | */ |
| 204 | export 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. |
no test coverage detected