MCPcopy Create free account
hub / github.com/Effect-TS/effect / searchInvalid

Function searchInvalid

packages/effect/src/encoding/Xml.ts:1021–1022  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

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

Callers 3

feedMethod · 0.85
checkCharsFunction · 0.85
writeMethod · 0.85

Calls 2

isWellFormedFunction · 0.90
searchMethod · 0.80

Tested by

no test coverage detected