MCPcopy
hub / github.com/jquery/esprima / parseJSXAttributeName

Method parseJSXAttributeName

src/jsx-parser.ts:383–398  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

381 }
382
383 parseJSXAttributeName(): JSXNode.JSXAttributeName {
384 const node = this.createJSXNode();
385 let attributeName: JSXNode.JSXAttributeName;
386
387 const identifier = this.parseJSXIdentifier();
388 if (this.matchJSX(':')) {
389 const namespace = identifier;
390 this.expectJSX(':');
391 const name = this.parseJSXIdentifier();
392 attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name));
393 } else {
394 attributeName = identifier;
395 }
396
397 return attributeName;
398 }
399
400 parseJSXStringLiteralAttribute(): Node.Literal {
401 const node = this.createJSXNode();

Callers 1

Calls 5

createJSXNodeMethod · 0.95
parseJSXIdentifierMethod · 0.95
matchJSXMethod · 0.95
expectJSXMethod · 0.95
finalizeMethod · 0.80

Tested by

no test coverage detected