(
sourceFilePath: string,
projectId: string,
options: SnapshotOptions = {}
)
| 149 | * @returns The parsed DeepnoteSnapshot or null if not found |
| 150 | */ |
| 151 | export 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. |
no test coverage detected