ohctechv3/.svn/pristine/4f/4fae9a37b6f76a54fce37f533fa81cefa40b705e.svn-base
2024-10-28 15:03:36 +05:30

17 lines
428 B
Plaintext

'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;