@gera2ld/jsx-dom
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -1,2 +0,2 @@ | ||
/*! @gera2ld/jsx-dom v2.2.0 | ISC License */ | ||
/*! @gera2ld/jsx-dom v2.2.1 | ISC License */ | ||
(function (exports) { | ||
@@ -88,4 +88,8 @@ 'use strict'; | ||
function flatten(arr) { | ||
return arr.reduce((prev, item) => prev.concat(item), []); | ||
} | ||
function mountChildren(children, env) { | ||
return Array.isArray(children) ? children.map(child => mount(child, env)) : mount(children, env); | ||
return Array.isArray(children) ? flatten(children.map(child => mountChildren(child, env))) : mount(children, env); | ||
} | ||
@@ -92,0 +96,0 @@ |
{ | ||
"name": "@gera2ld/jsx-dom", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Use JSX for HTML elements.", | ||
@@ -5,0 +5,0 @@ "author": "Gerald <i@gerald.top>", |
@@ -29,3 +29,3 @@ import { VType, VTYPE_ELEMENT, VTYPE_FUNCTION } from './consts'; | ||
export declare type VChild = string | number | boolean | null | Node | VNode; | ||
export declare type VChildren = VChild | VChild[]; | ||
export declare type VChildren = VChild | VChildren[]; | ||
export interface MountEnv { | ||
@@ -32,0 +32,0 @@ isSvg: boolean; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
21831
564