(char, input, position)
| 51510 | function collectASequenceOfCodePoints(condition, input, position) { |
| 51511 | let result = ""; |
| 51512 | while (position.position < input.length && condition(input[position.position])) { |
| 51513 | result += input[position.position]; |
| 51514 | position.position++; |
| 51515 | } |
| 51516 | return result; |
| 51517 | } |
| 51518 | function collectASequenceOfCodePointsFast(char, input, position) { |
| 51519 | const idx = input.indexOf(char, position.position); |
| 51520 | const start = position.position; |
| 51521 | if (idx === -1) { |
| 51522 | position.position = input.length; |
| 51523 | return input.slice(start); |
| 51524 | } |
no test coverage detected
searching dependent graphs…