(html: string)
| 10 | } |
| 11 | |
| 12 | export const htmlToElement = <T extends Element>(html: string): T => { |
| 13 | const template = window.document.createElement("template"); |
| 14 | const trimmedHtml = html.trim(); // Never return a text node of whitespace as the result |
| 15 | template.innerHTML = trimmedHtml; |
| 16 | return template.content.firstChild as T; |
| 17 | }; |
| 18 | |
| 19 | export function cloneDeep<T>(object: T): T { |
| 20 | try { |