MCPcopy
hub / github.com/lingodotdev/lingo.dev / getJsxScopeAttribute

Function getJsxScopeAttribute

packages/compiler/src/utils/jsx-scope.ts:64–74  ·  view source on GitHub ↗
(path: NodePath<t.JSXElement>)

Source from the content-addressed store, hash-verified

62}
63
64export function getJsxScopeAttribute(path: NodePath<t.JSXElement>) {
65 const attribute = path.node.openingElement.attributes.find(
66 (attr) =>
67 attr.type === "JSXAttribute" && attr.name.name === "data-jsx-scope",
68 );
69 return attribute &&
70 t.isJSXAttribute(attribute) &&
71 t.isStringLiteral(attribute.value)
72 ? attribute.value.value
73 : undefined;
74}

Callers 3

jsx-scope.spec.tsFile · 0.90
hasJsxScopeAttributeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected