MCPcopy Index your code
hub / github.com/redis/node-redis / #decodeBlobString

Method #decodeBlobString

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

Source from the content-addressed store, hash-verified

514 }
515
516 #decodeBlobString(type, chunk) {
517 // RESP 2 bulk string null
518 // https://github.com/redis/redis-specifications/blob/master/protocol/RESP2.md#resp-bulk-strings
519 if (chunk[this.#cursor] === ASCII['-']) {
520 this.#cursor += 4; // skip -1\r\n
521 return null;
522 }
523
524 const length = this.#decodeUnsingedNumber(0, chunk);
525 if (typeof length === 'function') {
526 return this.#continueDecodeBlobStringLength.bind(this, length, type);
527 } else if (this.#cursor >= chunk.length) {
528 return this.#decodeBlobStringWithLength.bind(this, length, type);
529 }
530
531 return this.#decodeBlobStringWithLength(length, type, chunk);
532 }
533
534 #continueDecodeBlobStringLength(lengthCb, type, chunk) {
535 const length = lengthCb(chunk);

Callers 4

#decodeTypeValueMethod · 0.95
#decodeBlobErrorMethod · 0.95
#decodeMapKeyValueMethod · 0.95

Calls 2

#decodeUnsingedNumberMethod · 0.95

Tested by

no test coverage detected