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

Function concat

packages/sql/pg/src/PgConnection.ts:1238–1248  ·  view source on GitHub ↗
(chunks: ReadonlyArray<Uint8Array>)

Source from the content-addressed store, hash-verified

1236 * `socket.write`. Every byte is initialized before the buffer is returned.
1237 */
1238const concat = (chunks: ReadonlyArray<Uint8Array>): Uint8Array => {
1239 let length = 0
1240 for (let index = 0; index < chunks.length; index++) length += chunks[index].length
1241 const output = Buffer.allocUnsafe(length)
1242 let offset = 0
1243 for (let index = 0; index < chunks.length; index++) {
1244 output.set(chunks[index], offset)
1245 offset += chunks[index].length
1246 }
1247 return output
1248}
1249
1250const emptyParams: ReadonlyArray<unknown> = []
1251

Callers 6

PgConnectionImplClass · 0.70
PgConnection.tsFile · 0.70
encodeUnnamedFunction · 0.70
encodeBatchFunction · 0.70
encodeQueryFunction · 0.70
takeClosesMethod · 0.70

Calls 1

setMethod · 0.65

Tested by

no test coverage detected