(id: string)
| 26 | } |
| 27 | |
| 28 | export function getPreview(id: string): string | null { |
| 29 | const entry = store.get(id); |
| 30 | if (!entry) return null; |
| 31 | if (Date.now() > entry.expiresAt) { |
| 32 | store.delete(id); |
| 33 | return null; |
| 34 | } |
| 35 | return entry.html; |
| 36 | } |
| 37 | |
| 38 | export function cleanExpiredPreviews(): void { |
| 39 | const now = Date.now(); |
no test coverage detected