UNPKG

react-kiwi-dropdown

Version:

A minimal, easy-to-use and highly adjustable dropdown component made with ReactJS.

17 lines (14 loc) 413 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.length === 0) { return node.name; } return attributes[attributes.length - 1]; } module.exports = getTokenBeforeClosingBracket;