| 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 |