Skip to content

Commit

Permalink
improve some internals
Browse files Browse the repository at this point in the history
  • Loading branch information
huang2002 committed Feb 1, 2019
1 parent ce3f73f commit 5646a24
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/HNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const toNodeArr = function toNodes(

if (_isArray(src) && src.length) {

return src.flat(_Infinity).map(s => toNodeArr(s, context, ownerNode, owner)).flat();
return src.flat(_Infinity).flatMap(s => toNodeArr(s, context, ownerNode, owner));

} else if (isHNode(src)) {

Expand Down
5 changes: 3 additions & 2 deletions test/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@

<body>
<div id="portal"></div>
<script src="../dist/hyper-ui.core.umd.js"></script>
<script src="./test.js"></script>
<script type="text/javascript" crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/hpolyfill" defer="defer"></script>
<script src="../dist/hyper-ui.core.umd.js" defer="defer"></script>
<script src="./test.js" defer="defer"></script>
</body>

</html>
7 changes: 6 additions & 1 deletion test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"compilerOptions": {
"target": "esnext",
"target": "es5",
"module": "none",
"jsx": "react",
"lib": [
"dom",
"es2015",
"es2016"
],
"jsxFactory": "HUI",
"outFile": "./test.js",
"rootDir": "./src",
Expand Down

0 comments on commit 5646a24

Please sign in to comment.