Introduce removeElementFromParent helper

This commit is contained in:
Daniel Imms
2020-06-04 07:20:59 -07:00
parent fb25be3ecd
commit 15f1759580
4 changed files with 17 additions and 9 deletions
+10
View File
@@ -0,0 +1,10 @@
/**
* Copyright (c) 2020 The xterm.js authors. All rights reserved.
* @license MIT
*/
export function removeElementFromParent(...elements: (HTMLElement | undefined)[]): void {
for (const e of elements) {
e?.parentElement?.removeChild(e);
}
}