MCPcopy Index your code
hub / github.com/liuup/claude-code-analysis / finalizeOutput

Function finalizeOutput

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

Source from the content-addressed store, hash-verified

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

Callers 1

readTranscriptForLoadFunction · 0.85

Calls 2

hasPrefixFunction · 0.85
sinkWriteFunction · 0.85

Tested by

no test coverage detected