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

Method addCString

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

Source from the content-addressed store, hash-verified

24 }
25
26 public addCString(val: string, front?: boolean) {
27 const len = Buffer.byteLength(val)
28 const buffer = Buffer.alloc(len + 1)
29 buffer.write(val)
30 buffer[len] = 0
31 return this.add(buffer, front)
32 }
33
34 public addString(val: string, front?: boolean) {
35 const len = Buffer.byteLength(val)

Callers 2

errorOrNoticeFunction · 0.95
test-buffers.tsFile · 0.45

Calls 2

addMethod · 0.95
writeMethod · 0.80

Tested by

no test coverage detected