MCPcopy
hub / github.com/di-sukharev/opencommit / we

Function we

out/cli.cjs:7440–7450  ·  view source on GitHub ↗
(e3, t2)

Source from the content-addressed store, hash-verified

7438 t2.bytesFilled > 0 && ye(e3, t2.buffer, t2.byteOffset, t2.bytesFilled), Ce(e3);
7439}
7440function we(e3, t2) {
7441 const r3 = t2.elementSize, o3 = t2.bytesFilled - t2.bytesFilled % r3, n2 = Math.min(e3._queueTotalSize, t2.byteLength - t2.bytesFilled), a4 = t2.bytesFilled + n2, i3 = a4 - a4 % r3;
7442 let l3 = n2, s2 = false;
7443 i3 > o3 && (l3 = i3 - t2.bytesFilled, s2 = true);
7444 const u3 = e3._queue;
7445 for (; l3 > 0; ) {
7446 const r4 = u3.peek(), o4 = Math.min(l3, r4.byteLength), n3 = t2.byteOffset + t2.bytesFilled;
7447 ie2(t2.buffer, n3, r4.buffer, r4.byteOffset, o4), r4.byteLength === o4 ? u3.shift() : (r4.byteOffset += o4, r4.byteLength -= o4), e3._queueTotalSize -= o4, Se(e3, o4, t2), l3 -= o4;
7448 }
7449 return s2;
7450}
7451function Se(e3, t2, r3) {
7452 r3.bytesFilled += t2;
7453}

Callers 2

TeFunction · 0.85
readMethod · 0.85

Calls 5

ie2Function · 0.85
SeFunction · 0.85
minMethod · 0.45
peekMethod · 0.45
shiftMethod · 0.45

Tested by

no test coverage detected