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

Function isNameStartCode

packages/effect/src/encoding/Xml.ts:1038–1044  ·  view source on GitHub ↗
(c: number)

Source from the content-addressed store, hash-verified

1036// Name characters of XML 1.0 fifth edition. Supplementary characters are
1037// accepted by their surrogates, which are paired once input is validated.
1038const isNameStartCode = (c: number): boolean =>
1039 c < 128 ?
1040 (asciiName[c] & NAME_START) !== 0 :
1041 (c >= 0xC0 && c <= 0xD6) || (c >= 0xD8 && c <= 0xF6) || (c >= 0xF8 && c <= 0x2FF) ||
1042 (c >= 0x370 && c <= 0x37D) || (c >= 0x37F && c <= 0x1FFF) || (c >= 0x200C && c <= 0x200D) ||
1043 (c >= 0x2070 && c <= 0x218F) || (c >= 0x2C00 && c <= 0x2FEF) || (c >= 0x3001 && c <= 0xD7FF) ||
1044 (c >= 0xF900 && c <= 0xFDCF) || (c >= 0xFDF0 && c <= 0xFFFD) || (c >= 0xD800 && c <= 0xDB7F)
1045
1046const isNameCode = (c: number): boolean =>
1047 c < 128 ?

Callers 3

isNameCodeFunction · 0.85
scanNameFunction · 0.85
qnameColonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected