This commit is contained in:
Alex Dima
2018-11-15 15:24:07 +01:00
parent 4fd60ed5b5
commit 5afd6bb79e
2 changed files with 9 additions and 3 deletions

View File

@@ -20,6 +20,12 @@ export function clearNode(node: HTMLElement): void {
}
}
export function removeNode(node: HTMLElement): void {
if (node.parentNode) {
node.parentNode.removeChild(node);
}
}
export function isInDOM(node: Node | null): boolean {
while (node) {
if (node === document.body) {