MCPcopy
hub / github.com/electric-sql/pglite / concatBuffers

Function concatBuffers

packages/pg-protocol/test/inbound-parser.test.ts:249–262  ·  view source on GitHub ↗
(views: ArrayBufferView[])

Source from the content-addressed store, hash-verified

247}
248
249function concatBuffers(views: ArrayBufferView[]): Uint8Array {
250 let length = 0
251 for (const v of views) length += v.byteLength
252
253 const buf = new Uint8Array(length)
254 let offset = 0
255 for (const v of views) {
256 const uint8view = new Uint8Array(v.buffer)
257 buf.set(uint8view, offset)
258 offset += uint8view.byteLength
259 }
260
261 return buf
262}
263
264describe('PgPacketStream', () => {
265 testForMessage(authOkBuffer, expectedAuthenticationOkayMessage)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected