MCPcopy Index your code
hub / github.com/electric-sql/pglite / cstring

Method cstring

packages/pg-protocol/src/buffer-reader.ts:54–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52 }
53
54 public cstring(): string {
55 // const start = this.#offset
56 // let end = start
57 // while (this.#bufferView[end++] !== 0) {}
58
59 const start = this.#offset
60 let end = start
61 while (this.#bufferView.getUint8(end++) !== 0) {
62 // no-op - increment until terminator reached
63 }
64 const result = this.string(end - start - 1)
65 this.#offset = end
66 return result
67 }
68
69 public bytes(length: number): Uint8Array {
70 // const result = this.buffer.slice(this.#offset, this.#offset + length)

Callers 6

#parseFieldMethod · 0.80
#parseErrorMessageMethod · 0.80

Calls 1

stringMethod · 0.95

Tested by

no test coverage detected