You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
428 B
16 lines
428 B
'use strict'; |
|
|
|
/** |
|
* Find the token before the closing bracket. |
|
* @param {ASTNode} node - The JSX element node. |
|
* @returns {Token} The token before the closing bracket. |
|
*/ |
|
function getTokenBeforeClosingBracket(node) { |
|
const attributes = node.attributes; |
|
if (!attributes || attributes.length === 0) { |
|
return node.name; |
|
} |
|
return attributes[attributes.length - 1]; |
|
} |
|
|
|
module.exports = getTokenBeforeClosingBracket;
|
|
|