(s: string)
| 1019 | // or -1. `isWellFormed` finds unpaired surrogates much faster than the `u` |
| 1020 | // regex, which is slow on non-ASCII text. |
| 1021 | const searchInvalid = (s: string): number => |
| 1022 | s.search(invalidDecodedChar) === -1 && isWellFormed(s) ? -1 : s.search(invalidChar) |
| 1023 | |
| 1024 | const isChar = (c: number): boolean => |
| 1025 | c === TAB || c === LF || c === CR || (c >= 0x20 && c <= 0xD7FF) || (c >= 0xE000 && c <= 0xFFFD) || |
no test coverage detected