MCPcopy Index your code
hub / github.com/codeaashu/claude-code / sinkWrite

Function sinkWrite

src/utils/sessionStoragePortable.ts:525–537  ·  view source on GitHub ↗
(s: Sink, src: Buffer, start: number, end: number)

Source from the content-addressed store, hash-verified

523type Sink = { buf: Buffer; len: number; cap: number }
524
525function sinkWrite(s: Sink, src: Buffer, start: number, end: number): void {
526 const n = end - start
527 if (n <= 0) return
528 if (s.len + n > s.buf.length) {
529 const grown = Buffer.allocUnsafe(
530 Math.min(Math.max(s.buf.length * 2, s.len + n), s.cap),
531 )
532 s.buf.copy(grown, 0, 0, s.len)
533 s.buf = grown
534 }
535 src.copy(s.buf, s.len, start, end)
536 s.len += n
537}
538
539function hasPrefix(
540 src: Buffer,

Callers 3

processStraddleFunction · 0.85
scanChunkLinesFunction · 0.85
finalizeOutputFunction · 0.85

Calls 1

maxMethod · 0.80

Tested by

no test coverage detected