source: imaps-frontend/node_modules/eslint-plugin-react/lib/util/getTokenBeforeClosingBracket.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 428 bytes
Line 
1'use strict';
2
3/**
4 * Find the token before the closing bracket.
5 * @param {ASTNode} node - The JSX element node.
6 * @returns {Token} The token before the closing bracket.
7 */
8function getTokenBeforeClosingBracket(node) {
9 const attributes = node.attributes;
10 if (!attributes || attributes.length === 0) {
11 return node.name;
12 }
13 return attributes[attributes.length - 1];
14}
15
16module.exports = getTokenBeforeClosingBracket;
Note: See TracBrowser for help on using the repository browser.