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

Method cString

packages/sql/pg/src/PgProtocol.ts:648–656  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

646 }
647
648 cString(): string {
649 const end = this.bytes.indexOf(0, this.offset)
650 if (end === -1 || end >= this.limit) {
651 throw new ParseError({ message: "Unterminated string" })
652 }
653 const value = decodeUtf8(this.bytes, this.offset, end - this.offset)
654 this.offset = end + 1
655 return value
656 }
657}
658
659/** Below this length a per-character loop beats `TextDecoder.decode`. */

Callers

nothing calls this directly

Calls 1

decodeUtf8Function · 0.70

Tested by

no test coverage detected