|
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:
409 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | /**
|
|---|
| 2 | * Extractor function for a JSXFragment type value node.
|
|---|
| 3 | *
|
|---|
| 4 | * Returns self-closing element with correct name.
|
|---|
| 5 | */
|
|---|
| 6 | export default function extractValueFromJSXFragment(value) {
|
|---|
| 7 | // eslint-disable-next-line global-require
|
|---|
| 8 | const getValue = require('.').default;
|
|---|
| 9 |
|
|---|
| 10 | if (value.children.length === 0) {
|
|---|
| 11 | return '<></>';
|
|---|
| 12 | }
|
|---|
| 13 | return `<>${[].concat(value.children).map((x) => getValue(x)).join('')}</>`;
|
|---|
| 14 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.