* @param {(char: number) => boolean} condition * @param {Buffer} input * @param {{ position: number }} position
(condition, input, position)
| 473 | * @param {{ position: number }} position |
| 474 | */ |
| 475 | function collectASequenceOfBytes (condition, input, position) { |
| 476 | let start = position.position |
| 477 | |
| 478 | while (start < input.length && condition(input[start])) { |
| 479 | ++start |
| 480 | } |
| 481 | |
| 482 | return input.subarray(position.position, (position.position = start)) |
| 483 | } |
| 484 | |
| 485 | /** |
| 486 | * @param {Buffer} buf |
no test coverage detected