|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
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 | */
|
|---|
| 8 | function 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 |
|
|---|
| 16 | module.exports = getTokenBeforeClosingBracket;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.