MCPcopy Index your code
hub / github.com/getsentry/sentry / getJsxTagName

Method getJsxTagName

scripts/extractFormFields.ts:309–325  ·  view source on GitHub ↗
(
    node: ts.JsxElement | ts.JsxSelfClosingElement,
    sourceFile: ts.SourceFile
  )

Source from the content-addressed store, hash-verified

307 }
308
309 private getJsxTagName(
310 node: ts.JsxElement | ts.JsxSelfClosingElement,
311 sourceFile: ts.SourceFile
312 ): string | null {
313 const tagName = ts.isJsxElement(node) ? node.openingElement.tagName : node.tagName;
314
315 if (ts.isIdentifier(tagName)) {
316 return tagName.text;
317 }
318
319 if (ts.isPropertyAccessExpression(tagName)) {
320 // e.g., form.AppField or field.Input
321 return tagName.getText(sourceFile);
322 }
323
324 return null;
325 }
326
327 /** Returns true if the JSX element has an attribute with the given name, regardless of its value. */
328 private hasJsxAttribute(

Callers 3

findFormSearchesMethod · 0.95
extractFieldFromJsxMethod · 0.95
visitMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected