(index: number)
| 688 | // trimming the leading and trailing zero groups is two moving indices |
| 689 | // instead of an array and a `shift` per leading zero. |
| 690 | const groupAt = (index: number): number => { |
| 691 | const at = index * 4 |
| 692 | return (digits.charCodeAt(at) - 48) * 1000 + (digits.charCodeAt(at + 1) - 48) * 100 + |
| 693 | (digits.charCodeAt(at + 2) - 48) * 10 + (digits.charCodeAt(at + 3) - 48) |
| 694 | } |
| 695 | const groupCount = digits.length / 4 |
| 696 | let first = 0 |
| 697 | while (first < groupCount && groupAt(first) === 0) first++ |