MCPcopy Create free account
hub / github.com/Effect-TS/effect / append

Function append

packages/sql/pg/src/PgProtocol.ts:122–137  ·  view source on GitHub ↗
(chunk: Uint8Array)

Source from the content-addressed store, hash-verified

120 // messages while a low-volume one stays small. A single oversized message
121 // grows its buffer beyond the pool without raising the pool itself.
122 const append = (chunk: Uint8Array): void => {
123 if (end + chunk.length > buffer.length) {
124 const pending = end - start
125 if (bufferSize < maxBufferSize) bufferSize *= 2
126 let capacity = bufferSize
127 while (capacity < pending + chunk.length) capacity *= 2
128 const next = new Uint8Array(capacity)
129 next.set(buffer.subarray(start, end))
130 buffer = next
131 store = next.buffer
132 start = 0
133 end = pending
134 }
135 buffer.set(chunk, end)
136 end += chunk.length
137 }
138
139 const parser: Parser<A> = {
140 readField: options?.readField,

Callers 1

pushEachFunction · 0.70

Calls 1

setMethod · 0.65

Tested by

no test coverage detected