From 5646a242b3cf7c2ba7a8c01279768d4e5b0d383b Mon Sep 17 00:00:00 2001 From: hhh <1340545944@qq.com> Date: Fri, 1 Feb 2019 13:13:18 +0800 Subject: [PATCH] improve some internals --- src/core/HNode.ts | 2 +- test/test.html | 5 +++-- test/tsconfig.json | 7 ++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/core/HNode.ts b/src/core/HNode.ts index 2b7910a..4c5a7a1 100644 --- a/src/core/HNode.ts +++ b/src/core/HNode.ts @@ -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)) { diff --git a/test/test.html b/test/test.html index 1900f3a..3dbdc67 100644 --- a/test/test.html +++ b/test/test.html @@ -19,8 +19,9 @@
- - + + +