MCPcopy
hub / github.com/claude-code-best/claude-code / finalizeOutput

Function finalizeOutput

src/utils/sessionStoragePortable.ts:697–713  ·  view source on GitHub ↗
(s: LoadState)

Source from the content-addressed store, hash-verified

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

Callers 1

readTranscriptForLoadFunction · 0.85

Calls 2

hasPrefixFunction · 0.85
sinkWriteFunction · 0.85

Tested by

no test coverage detected