* Append one or several elements to the parent * * @param {Element|DocumentFragment} parent - where to append * @param {Element|Element[]|DocumentFragment|Text|Text[]} elements - element or elements list
(
parent: Element | DocumentFragment,
elements: Element | Element[] | DocumentFragment | Text | Text[]
)
| 91 | * @param {Element|Element[]|DocumentFragment|Text|Text[]} elements - element or elements list |
| 92 | */ |
| 93 | public static append( |
| 94 | parent: Element | DocumentFragment, |
| 95 | elements: Element | Element[] | DocumentFragment | Text | Text[] |
| 96 | ): void { |
| 97 | if (Array.isArray(elements)) { |
| 98 | elements.forEach((el) => parent.appendChild(el)); |
| 99 | } else { |
| 100 | parent.appendChild(elements); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * Append element or a couple to the beginning of the parent elements |
no test coverage detected