MCPcopy Index your code
hub / github.com/codeaashu/claude-code / cacheImagePath

Function cacheImagePath

src/utils/imageStore.ts:41–49  ·  view source on GitHub ↗
(content: PastedContent)

Source from the content-addressed store, hash-verified

39 * Cache the image path immediately (fast, no file I/O).
40 */
41export 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.

Callers 3

onImagePasteFunction · 0.85
onImagePasteFunction · 0.85

Calls 3

getImagePathFunction · 0.85
evictOldestIfAtCapFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected