MCPcopy Index your code
hub / github.com/callstack/agent-device / readOpeningTagEnd

Method readOpeningTagEnd

src/utils/xml.ts:129–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127 }
128
129 private readOpeningTagEnd(): 'open' | 'self-closing' | null {
130 if (this.index >= this.xml.length) throw new Error('Opening XML tag is not closed.');
131 if (this.xml[this.index] === '>') {
132 this.index += 1;
133 return 'open';
134 }
135 if (this.xml[this.index] === '/' && this.xml[this.index + 1] === '>') {
136 this.index += 2;
137 return 'self-closing';
138 }
139 return null;
140 }
141
142 private readAttribute(): { name: string; value: string } {
143 const name = this.readRequiredName(`Invalid XML attribute at offset ${this.index}.`);

Callers 1

readOpeningTagBodyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected