@zsnout/ithkuil
Version:
A set of tools which can generate and parse romanized Ithkuil text and which can generate Ithkuil script from text and JSON data.
20 lines (19 loc) • 572 B
JavaScript
/// <reference types="./env.d.ts" />
function d(t, e, ...n) {
if (typeof t == "function")
return (
e &&
!("children" in e) &&
(n.length == 1 ?
(e.children = n[0])
: n.length > 1 && (e.children = n)),
t(e)
)
let r = document.createElementNS("http://www.w3.org/2000/svg", t)
e &&
"children" in e &&
(n = Array.isArray(e.children) ? e.children : [e.children])
for (let i in e) i != "children" && r.setAttribute(i, e[i])
return r.append(...n.filter((i) => i != null)), r
}
export { d as jsx, d as jsxs }