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

Function scanName

packages/effect/src/encoding/Xml.ts:1053–1058  ·  view source on GitHub ↗
(s: string, i: number, end: number)

Source from the content-addressed store, hash-verified

1051
1052// Returns the end of the name starting at `i`, or `i` when there is none
1053const 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
1061const isName = (s: string): boolean => s.length > 0 && scanName(s, 0, s.length) === s.length && isWellFormed(s)

Callers 5

isNameFunction · 0.85
startTagMethod · 0.85
endTagMethod · 0.85
processingInstructionMethod · 0.85
nameMethod · 0.85

Calls 2

isNameStartCodeFunction · 0.85
isNameCodeFunction · 0.85

Tested by

no test coverage detected