initial commit (work in progress)
This commit is contained in:
parent
13fdb60f66
commit
559369016d
83 changed files with 10461 additions and 0 deletions
7
render/normalizeChildren.js
Normal file
7
render/normalizeChildren.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
module.exports = function normalizeChildren(children) {
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
if (children[i] instanceof Array) children[i] = {tag: "[", key: undefined, attrs: undefined, children: normalizeChildren(children[i]), text: undefined}
|
||||
else if (children[i] != null && typeof children[i] !== "object") children[i] = {tag: "#", key: undefined, attrs: undefined, children: children[i], text: undefined}
|
||||
}
|
||||
return children
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue