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

Method readCdata

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

Source from the content-addressed store, hash-verified

185 }
186
187 private readCdata(): void {
188 const startIndex = this.index + '<![CDATA['.length;
189 const endIndex = this.xml.indexOf(']]>', startIndex);
190 if (endIndex === -1) throw new Error('CDATA section is not closed.');
191 this.appendText(this.xml.slice(startIndex, endIndex), false);
192 this.index = endIndex + ']]>'.length;
193 }
194
195 private appendText(text: string, decodeEntities: boolean): void {
196 const trimmed = text.trim();

Callers 1

resolveMarkupReaderMethod · 0.95

Calls 1

appendTextMethod · 0.95

Tested by

no test coverage detected