Fix error when passing undefined into tag generator

This commit is contained in:
Talia 2023-12-30 13:17:36 +01:00
parent b476b8651e
commit f79e7a9c14
Signed by: darkwiiplayer
GPG key ID: 7808674088232B3E
2 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{
"name": "skooma",
"version": "1.6.0",
"version": "1.6.1",
"author": "darkwiiplayer",
"license": "Unlicense",
"main": "skooma.js",

View file

@ -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)