MCPcopy
hub / github.com/codeaashu/claude-code / retrievePastedText

Function retrievePastedText

src/utils/pasteStore.ts:59–70  ·  view source on GitHub ↗
(hash: string)

Source from the content-addressed store, hash-verified

57 * Returns null if not found or on error.
58 */
59export async function retrievePastedText(hash: string): Promise<string | null> {
60 try {
61 const pastePath = getPastePath(hash)
62 return await readFile(pastePath, { encoding: 'utf8' })
63 } catch (error) {
64 // ENOENT is expected when paste doesn't exist
65 if (!isENOENT(error)) {
66 logForDebugging(`Failed to retrieve paste ${hash}: ${error}`)
67 }
68 return null
69 }
70}
71
72/**
73 * Clean up old paste files that are no longer referenced.

Callers 1

Calls 4

getPastePathFunction · 0.85
readFileFunction · 0.85
isENOENTFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected