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

Method readAttribute

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

Source from the content-addressed store, hash-verified

140 }
141
142 private readAttribute(): { name: string; value: string } {
143 const name = this.readRequiredName(`Invalid XML attribute at offset ${this.index}.`);
144 assertSafeXmlAttributeName(name);
145 this.skipWhitespace();
146 if (this.xml[this.index] !== '=') {
147 throw new Error(`Missing value for XML attribute "${name}".`);
148 }
149 this.index += 1;
150 this.skipWhitespace();
151 return { name, value: this.readAttributeValue(name) };
152 }
153
154 private pushOpenNode(node: XmlNode): void {
155 if (this.stack.length >= MAX_XML_NESTING_DEPTH) {

Callers 1

readOpeningTagBodyMethod · 0.95

Calls 4

readRequiredNameMethod · 0.95
skipWhitespaceMethod · 0.95
readAttributeValueMethod · 0.95

Tested by

no test coverage detected