Fix error when passing undefined
into tag generator
This commit is contained in:
parent
b476b8651e
commit
f79e7a9c14
2 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "skooma",
|
||||
"version": "1.6.0",
|
||||
"version": "1.6.1",
|
||||
"author": "darkwiiplayer",
|
||||
"license": "Unlicense",
|
||||
"main": "skooma.js",
|
||||
|
|
|
@ -49,6 +49,8 @@ const getCustom = args => args.reduce(
|
|||
,undefined
|
||||
)
|
||||
|
||||
const isElement = object => HTMLElement.prototype.isPrototypeOf(object)
|
||||
|
||||
const isReactive = object => object
|
||||
&& (typeof object == "object")
|
||||
&& ("addEventListener" in object)
|
||||
|
@ -57,7 +59,7 @@ const isReactive = object => object
|
|||
const toChild = arg => {
|
||||
if (typeof arg == "string" || typeof arg == "number") {
|
||||
return document.createTextNode(arg)
|
||||
} else if ("nodeName" in arg) {
|
||||
} else if (isElement(arg)) {
|
||||
return arg
|
||||
} else if (isReactive(arg)) {
|
||||
return reactiveChild(arg)
|
||||
|
|
Loading…
Reference in a new issue