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:
409 bytes
|
Line | |
---|
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.