param fn export function embed ( fn ) { const script = document . createElement ( 'script' ) ; script . text = `(${ fn . toString ( ) })();` ; document . documentElement . appendChild ( script ) ; } param html export function htmlToElement ( html ) { const template = document . createElement ( 'template' ) ; html = html . trim ( ) ; template . innerHTML = html ; return template . content . firstChild as ChildNode ; }