1 |
|
2 |
|
3 | var formatChildren = require('./base-format-children')
|
4 |
|
5 | function applyChildren (element, children) {
|
6 | if (process.env.NODE_ENV !== 'production' && !element.flags) {
|
7 | throw new Error(JSON.stringify(element) + ' is not a valid element')
|
8 | }
|
9 | if (children) {
|
10 | element.children = children.length === 1 ? children[0] : children
|
11 | }
|
12 | return element
|
13 | }
|
14 |
|
15 | exports.formatChildren = formatChildren.bind(null, applyChildren)
|