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

Method readAttributeValue

src/utils/xml.ts:227–240  ·  view source on GitHub ↗
(attributeName: string)

Source from the content-addressed store, hash-verified

225 }
226
227 private readAttributeValue(attributeName: string): string {
228 const quote = this.xml[this.index];
229 if (quote !== '"' && quote !== "'") {
230 throw new Error(`XML attribute "${attributeName}" must use a quoted value.`);
231 }
232 this.index += 1;
233 const startIndex = this.index;
234 const endIndex = this.xml.indexOf(quote, startIndex);
235 if (endIndex === -1) {
236 throw new Error(`XML attribute "${attributeName}" is not closed.`);
237 }
238 this.index = endIndex + 1;
239 return decodeXmlEntities(this.xml.slice(startIndex, endIndex).trim());
240 }
241
242 private skipDeclaration(): void {
243 const state: DeclarationScanState = { quote: null, bracketDepth: 0 };

Callers 1

readAttributeMethod · 0.95

Calls 1

decodeXmlEntitiesFunction · 0.85

Tested by

no test coverage detected