(type, chunk)
| 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, |
no test coverage detected