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

Method join

packages/pg-protocol/test/testing/buffer-list.ts:57–74  ·  view source on GitHub ↗
(appendLength?: boolean, char?: string)

Source from the content-addressed store, hash-verified

55 }
56
57 public join(appendLength?: boolean, char?: string): Uint8Array {
58 let length = this.getByteLength()
59 if (appendLength) {
60 this.addInt32(length + 4, true)
61 return this.join(false, char)
62 }
63 if (char) {
64 this.addChar(char, true)
65 length++
66 }
67 const result = new ArrayBuffer(length)
68 let index = 0
69 this.buffers.forEach((buffer) => {
70 new Uint8Array(result).set(new Uint8Array(buffer), index)
71 index += buffer.byteLength
72 })
73 return new Uint8Array(result)
74 }
75
76 public static concat(...args: ArrayBuffer[]): Uint8Array {
77 const total = new BufferList()

Callers 15

concatMethod · 0.95
sync-e2e.test.tsFile · 0.80
many_syncerFunction · 0.80
applyMessageToTableFunction · 0.80
applyInsertsToTableFunction · 0.80
copyFilesFunction · 0.80
cellValueFunction · 0.80
setupFunction · 0.80
tsup.config.tsFile · 0.80
uuidFunction · 0.80

Calls 3

getByteLengthMethod · 0.95
addInt32Method · 0.95
addCharMethod · 0.95

Tested by 1

many_syncerFunction · 0.64