diff --git a/package.json b/package.json index a1475c8..e57ba03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "skooma", - "version": "1.6.0", + "version": "1.6.1", "author": "darkwiiplayer", "license": "Unlicense", "main": "skooma.js", diff --git a/skooma.js b/skooma.js index bb32568..f440717 100644 --- a/skooma.js +++ b/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)