MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / asImageFilePath

Function asImageFilePath

source code/utils/imagePaste.ts:337–346  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

335 * @returns Cleaned text with quotes removed, whitespace trimmed, and shell escapes removed, or null if not an image path
336 */
337export function asImageFilePath(text: string): string | null {
338 const cleaned = removeOuterQuotes(text.trim())
339 const unescaped = stripBackslashEscapes(cleaned)
340
341 if (IMAGE_EXTENSION_REGEX.test(unescaped)) {
342 return unescaped
343 }
344
345 return null
346}
347
348/**
349 * Try to find and read an image file, falling back to clipboard search

Callers 1

tryReadImageFromPathFunction · 0.85

Calls 2

removeOuterQuotesFunction · 0.85
stripBackslashEscapesFunction · 0.85

Tested by

no test coverage detected