MCPcopy
hub / github.com/redis/node-redis / #continueDecodeSimpleString

Method #continueDecodeSimpleString

packages/client/lib/RESP/decoder.ts:503–514  ·  view source on GitHub ↗
(chunks, type, chunk)

Source from the content-addressed store, hash-verified

501 }
502
503 #continueDecodeSimpleString(chunks, type, chunk) {
504 const start = this.#cursor,
505 crlfIndex = this.#findCRLF(chunk, start);
506 if (crlfIndex === -1) {
507 chunks.push(chunk.subarray(start));
508 return this.#continueDecodeSimpleString.bind(this, chunks, type);
509 }
510
511 chunks.push(chunk.subarray(start, crlfIndex));
512 const buffer = Buffer.concat(chunks);
513 return type === Buffer ? buffer : buffer.toString();
514 }
515
516 #decodeBlobString(type, chunk) {
517 // RESP 2 bulk string null

Callers

nothing calls this directly

Calls 3

#findCRLFMethod · 0.95
toStringMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected