File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " simple-tsx" ,
3
- "version" : " 1.0.2 " ,
3
+ "version" : " 1.1.0 " ,
4
4
"description" : " A simple way to write tsx files. No babel required!" ,
5
5
"main" : " dist/index.js" ,
6
6
"type" : " commonjs" ,
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export default class Element {
6
6
constructor (
7
7
tagName : string ,
8
8
attributes : AttributesType | null ,
9
- ...children : ( Element | string | number ) [ ]
9
+ ...children : ( Element | string | number | null | undefined ) [ ]
10
10
) {
11
11
this . element = document . createElement ( tagName ) ;
12
12
const trueAttributes = attributes || { } ;
@@ -26,6 +26,8 @@ export default class Element {
26
26
node = document . createTextNode ( child ) ;
27
27
} else if ( typeof child === "number" ) {
28
28
node = document . createTextNode ( child . toString ( ) ) ;
29
+ } else if ( child === null || child === undefined ) {
30
+ return ;
29
31
} else {
30
32
node = child . element ;
31
33
}
You can’t perform that action at this time.
0 commit comments