(s: LoadState)
| 695 | } |
| 696 | |
| 697 | function 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 | |
| 715 | export async function readTranscriptForLoad( |
| 716 | filePath: string, |
no test coverage detected