(db: Database, designId: string)
| 395 | } |
| 396 | |
| 397 | export function listSnapshots(db: Database, designId: string): DesignSnapshot[] { |
| 398 | return readStore(db) |
| 399 | .snapshots.filter((snapshot) => snapshot.designId === designId) |
| 400 | .sort((a, b) => b.createdAt.localeCompare(a.createdAt)); |
| 401 | } |
| 402 | |
| 403 | export function getSnapshot(db: Database, id: string): DesignSnapshot | null { |
| 404 | return readStore(db).snapshots.find((snapshot) => snapshot.id === id) ?? null; |
no test coverage detected