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

Method #decodeSimpleString

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

Source from the content-addressed store, hash-verified

484 }
485
486 #decodeSimpleString(type, chunk) {
487 const start = this.#cursor,
488 crlfIndex = this.#findCRLF(chunk, start);
489 if (crlfIndex === -1) {
490 return this.#continueDecodeSimpleString.bind(
491 this,
492 [chunk.subarray(start)],
493 type
494 );
495 }
496
497 const slice = chunk.subarray(start, crlfIndex);
498 return type === Buffer ?
499 slice :
500 slice.toString();
501 }
502
503 #continueDecodeSimpleString(chunks, type, chunk) {
504 const start = this.#cursor,

Callers 7

#decodeTypeValueMethod · 0.95
#decodeNumberMethod · 0.95
#decodeBigNumberMethod · 0.95
#decodeDoubleMethod · 0.95
#decodeSimpleErrorMethod · 0.95
#decodeMapKeyValueMethod · 0.95

Calls 2

#findCRLFMethod · 0.95
toStringMethod · 0.65

Tested by

no test coverage detected