(s: LoadState)
| 697 | } |
| 698 | |
| 699 | function 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 | |
| 717 | export async function readTranscriptForLoad( |
| 718 | filePath: string, |
no test coverage detected