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

Function finalizeOutput

source code/utils/sessionStoragePortable.ts:701–717  ·  view source on GitHub ↗
(s: LoadState)

Source from the content-addressed store, hash-verified

699}
700
701function finalizeOutput(s: LoadState): void {
702 if (s.carryLen > 0) {
703 const cb = s.carryBuf!
704 if (hasPrefix(cb, ATTR_SNAP_PREFIX, 0, s.carryLen)) {
705 s.lastSnapSrc = cb
706 s.lastSnapLen = s.carryLen
707 } else {
708 sinkWrite(s.out, cb, 0, s.carryLen)
709 }
710 }
711 if (s.lastSnapSrc) {
712 if (s.out.len > 0 && s.out.buf[s.out.len - 1] !== LF) {
713 sinkWrite(s.out, LF_BYTE, 0, 1)
714 }
715 sinkWrite(s.out, s.lastSnapSrc, 0, s.lastSnapLen)
716 }
717}
718
719export async function readTranscriptForLoad(
720 filePath: string,

Callers 1

readTranscriptForLoadFunction · 0.85

Calls 2

hasPrefixFunction · 0.85
sinkWriteFunction · 0.85

Tested by

no test coverage detected