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