mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
17 lines
413 B
JavaScript
17 lines
413 B
JavaScript
'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.length === 0) {
|
|
return node.name;
|
|
}
|
|
return attributes[attributes.length - 1];
|
|
}
|
|
|
|
module.exports = getTokenBeforeClosingBracket;
|