(content: PastedContent)
| 39 | * Cache the image path immediately (fast, no file I/O). |
| 40 | */ |
| 41 | export function cacheImagePath(content: PastedContent): string | null { |
| 42 | if (content.type !== 'image') { |
| 43 | return null |
| 44 | } |
| 45 | const imagePath = getImagePath(content.id, content.mediaType || 'image/png') |
| 46 | evictOldestIfAtCap() |
| 47 | storedImagePaths.set(content.id, imagePath) |
| 48 | return imagePath |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Store an image from pastedContents to disk. |
no test coverage detected