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