main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
547 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports.default = extractValueFromJSXFragment;
|
---|
| 7 | /**
|
---|
| 8 | * Extractor function for a JSXFragment type value node.
|
---|
| 9 | *
|
---|
| 10 | * Returns self-closing element with correct name.
|
---|
| 11 | */
|
---|
| 12 | function extractValueFromJSXFragment(value) {
|
---|
| 13 | // eslint-disable-next-line global-require
|
---|
| 14 | var getValue = require('.').default;
|
---|
| 15 |
|
---|
| 16 | if (value.children.length === 0) {
|
---|
| 17 | return '<></>';
|
---|
| 18 | }
|
---|
| 19 | return '<>' + [].concat(value.children).map(function (x) {
|
---|
| 20 | return getValue(x);
|
---|
| 21 | }).join('') + '</>';
|
---|
| 22 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.