(s: string, i: number, end: number)
| 1051 | |
| 1052 | // Returns the end of the name starting at `i`, or `i` when there is none |
| 1053 | const scanName = (s: string, i: number, end: number): number => { |
| 1054 | if (i >= end || !isNameStartCode(s.charCodeAt(i))) return i |
| 1055 | i++ |
| 1056 | while (i < end && isNameCode(s.charCodeAt(i))) i++ |
| 1057 | return i |
| 1058 | } |
| 1059 | |
| 1060 | // Name characters exclude every invalid character but unpaired surrogates |
| 1061 | const isName = (s: string): boolean => s.length > 0 && scanName(s, 0, s.length) === s.length && isWellFormed(s) |
no test coverage detected