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

Method addString

packages/pg-protocol/test/testing/buffer-list.ts:41–46  ·  view source on GitHub ↗
(val: string, front?: boolean)

Source from the content-addressed store, hash-verified

39 }
40
41 public addString(val: string, front?: boolean) {
42 const len = byteLengthUtf8(val)
43 const bufferView = new Uint8Array(len)
44 new TextEncoder().encodeInto(val, bufferView)
45 return this.add(bufferView.buffer, front)
46 }
47
48 public addChar(char: string, first?: boolean) {
49 const bufferView = new TextEncoder().encode(char)

Callers 2

test-buffers.tsFile · 0.45

Calls 2

addMethod · 0.95
byteLengthUtf8Function · 0.90

Tested by

no test coverage detected