(length, skip, type, chunk)
| 543 | } |
| 544 | |
| 545 | #decodeStringWithLength(length, skip, type, chunk) { |
| 546 | const end = this.#cursor + length; |
| 547 | if (end >= chunk.length) { |
| 548 | const slice = chunk.subarray(this.#cursor); |
| 549 | this.#cursor = chunk.length; |
| 550 | return this.#continueDecodeStringWithLength.bind( |
| 551 | this, |
| 552 | length - slice.length, |
| 553 | [slice], |
| 554 | skip, |
| 555 | type |
| 556 | ); |
| 557 | } |
| 558 | |
| 559 | const slice = chunk.subarray(this.#cursor, end); |
| 560 | this.#cursor = end + skip; |
| 561 | return type === Buffer ? |
| 562 | slice : |
| 563 | slice.toString(); |
| 564 | } |
| 565 | |
| 566 | #continueDecodeStringWithLength(length, chunks, skip, type, chunk) { |
| 567 | const end = this.#cursor + length; |
no test coverage detected