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

Function checkChars

packages/effect/src/encoding/Xml.ts:2510–2516  ·  view source on GitHub ↗
(what: string, s: string)

Source from the content-addressed store, hash-verified

2508}
2509
2510const checkChars = (what: string, s: string): void => {
2511 const invalid = searchInvalid(s)
2512 if (invalid !== -1) {
2513 const code = s.codePointAt(invalid)!.toString(16).toUpperCase().padStart(4, "0")
2514 throw invalidEvent(`${what} contains the invalid character U+${code}`)
2515 }
2516}
2517
2518const checkName = (what: string, name: string): void => {
2519 if (typeof name !== "string" || !isName(name)) throw invalidEvent(`invalid ${what} ${JSON.stringify(name)}`)

Callers 2

checkAttributesMethod · 0.85
writeMethod · 0.85

Calls 3

searchInvalidFunction · 0.85
invalidEventFunction · 0.85
toStringMethod · 0.65

Tested by

no test coverage detected