( tag: keyof HTMLElementTagNameMap, className: string, content?: string )
| 8 | } |
| 9 | |
| 10 | export function createElement<T extends HTMLElement>( |
| 11 | tag: keyof HTMLElementTagNameMap, |
| 12 | className: string, |
| 13 | content?: string |
| 14 | ): T { |
| 15 | const e = window.document.createElement(tag) as T; |
| 16 | className = className || ""; |
| 17 | content = content || ""; |
| 18 | |
| 19 | e.className = className; |
| 20 | |
| 21 | if (content !== undefined) e.textContent = content; |
| 22 | |
| 23 | return e; |
| 24 | } |
| 25 | |
| 26 | export function clearNode(node: HTMLElement) { |
| 27 | while (node.firstChild) node.removeChild(node.firstChild); |
no outgoing calls
no test coverage detected
searching dependent graphs…