import htm from "htm"; export function h( tag: string | ((props: unknown) => string), props: Record, ...children: unknown[] ): string { if (typeof tag === "function") return tag({ ...props, children }); let attrs = ""; if (props) { for (const k in props) { if (props[k] != null && k !== "children") attrs += ` ${k}="${props[k]}"`; } } const content = children.flat().join(""); return `<${tag}${attrs}>${content}`; } const html = htm.bind(h) as unknown as ( strings: TemplateStringsArray, ...values: unknown[] ) => string; export { html };