Der Name eines JSX-Attributs als Text.
(node)
| 211 | |
| 212 | /** Der Name eines JSX-Attributs als Text. */ |
| 213 | function attributeName(node) { |
| 214 | const name = node.name; |
| 215 | if (name === undefined) { |
| 216 | return ''; |
| 217 | } |
| 218 | if (ts.isIdentifier(name) || ts.isStringLiteral(name)) { |
| 219 | return name.text; |
| 220 | } |
| 221 | return name.getText?.() ?? ''; |
| 222 | } |
| 223 | |
| 224 | /** Der Tagname eines JSX-Elements, oder leer. */ |
| 225 | function tagNameOf(opening) { |