Last change
on this file since 6a80231 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
736 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.default = buildChildren;
|
---|
7 |
|
---|
8 | var _generated = require("../../validators/generated");
|
---|
9 |
|
---|
10 | var _cleanJSXElementLiteralChild = require("../../utils/react/cleanJSXElementLiteralChild");
|
---|
11 |
|
---|
12 | function buildChildren(node) {
|
---|
13 | const elements = [];
|
---|
14 |
|
---|
15 | for (let i = 0; i < node.children.length; i++) {
|
---|
16 | let child = node.children[i];
|
---|
17 |
|
---|
18 | if ((0, _generated.isJSXText)(child)) {
|
---|
19 | (0, _cleanJSXElementLiteralChild.default)(child, elements);
|
---|
20 | continue;
|
---|
21 | }
|
---|
22 |
|
---|
23 | if ((0, _generated.isJSXExpressionContainer)(child)) child = child.expression;
|
---|
24 | if ((0, _generated.isJSXEmptyExpression)(child)) continue;
|
---|
25 | elements.push(child);
|
---|
26 | }
|
---|
27 |
|
---|
28 | return elements;
|
---|
29 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.