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

Method readOpeningTagBody

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

Source from the content-addressed store, hash-verified

116 }
117
118 private readOpeningTagBody(): { attributes: Record<string, string>; selfClosing: boolean } {
119 const attributes: Record<string, string> = {};
120 while (true) {
121 this.skipWhitespace();
122 const tagEnd = this.readOpeningTagEnd();
123 if (tagEnd) return { attributes, selfClosing: tagEnd === 'self-closing' };
124 const attribute = this.readAttribute();
125 attributes[attribute.name] = attribute.value;
126 }
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.');

Callers 1

readOpeningTagMethod · 0.95

Calls 3

skipWhitespaceMethod · 0.95
readOpeningTagEndMethod · 0.95
readAttributeMethod · 0.95

Tested by

no test coverage detected