MCPcopy
hub / github.com/brianc/node-postgres / parseBuffers

Function parseBuffers

packages/pg-protocol/src/inbound-parser.test.ts:234–243  ·  view source on GitHub ↗
(buffers: Buffer[])

Source from the content-addressed store, hash-verified

232}
233
234const parseBuffers = async (buffers: Buffer[]): Promise<BackendMessage[]> => {
235 const stream = new PassThrough()
236 for (const buffer of buffers) {
237 stream.write(buffer)
238 }
239 stream.end()
240 const msgs: BackendMessage[] = []
241 await parse(stream, (msg) => msgs.push(msg))
242 return msgs
243}
244
245describe('PgPacketStream', function () {
246 testForMessage(authOkBuffer, expectedAuthenticationOkayMessage)

Callers 4

testForMessageFunction · 0.85

Calls 3

writeMethod · 0.80
parseFunction · 0.70
endMethod · 0.45

Tested by

no test coverage detected