MCPcopy
hub / github.com/callstack/agent-device / readClosingTag

Method readClosingTag

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

Source from the content-addressed store, hash-verified

159 }
160
161 private readClosingTag(): void {
162 this.index += 2;
163 this.skipWhitespace();
164 const name = this.readName();
165 this.skipWhitespace();
166 if (this.xml[this.index] !== '>') {
167 throw new Error(`Closing XML tag </${name}> is not closed.`);
168 }
169 this.index += 1;
170
171 const node = this.stack.pop();
172 if (!node) {
173 throw new Error(`Unexpected closing XML tag </${name}>.`);
174 }
175 if (node.name !== name) {
176 throw new Error(`Expected </${node.name}> before </${name}>.`);
177 }
178 }
179
180 private readText(): void {
181 const nextTagIndex = this.xml.indexOf('<', this.index);

Callers 1

resolveMarkupReaderMethod · 0.95

Calls 2

skipWhitespaceMethod · 0.95
readNameMethod · 0.95

Tested by

no test coverage detected