Improve skooma warning on undefined arguments

This commit is contained in:
Talia 2023-03-01 11:01:49 +01:00
parent bef3fc5c31
commit 233a96d0e0

View file

@ -50,7 +50,7 @@ const parseArgs = (element, before, ...args) => {
if (typeof arg == "string" || typeof arg == "number") if (typeof arg == "string" || typeof arg == "number")
element.insertBefore(document.createTextNode(arg), before) element.insertBefore(document.createTextNode(arg), before)
else if (arg === undefined || arg == null) else if (arg === undefined || arg == null)
console.warn(`Argument is ${typeof arg}`, element) console.warn(`An argument of type ${typeof arg} has been ignored`, element)
else if (typeof arg == "function") else if (typeof arg == "function")
arg(element) arg(element)
else if ("nodeName" in arg) else if ("nodeName" in arg)