prettify, sorry for the big ass commit

This commit is contained in:
Olivier Gagnon
2021-09-04 19:09:30 -04:00
parent 3d7cdb4ef9
commit a18bdd6afc
554 changed files with 91615 additions and 66138 deletions
+18 -16
View File
@@ -7,22 +7,24 @@ import { getElementById } from "./getElementById";
* @param el The element or ID of an element to remove all children from.
*/
export function removeChildrenFromElement(el: string | null | Element): void {
if (el === null) {
return;
if (el === null) {
return;
}
try {
const elem: HTMLElement | Element = isString(el)
? getElementById(el as string)
: (el as Element);
if (elem instanceof Element) {
while (elem.firstChild !== null) {
elem.removeChild(elem.firstChild);
}
}
} catch (e) {
// tslint:disable-next-line:no-console
console.debug(e);
try {
const elem: HTMLElement | Element = (isString(el) ? getElementById(el as string) : el as Element);
if (elem instanceof Element) {
while (elem.firstChild !== null) {
elem.removeChild(elem.firstChild);
}
}
} catch (e) {
// tslint:disable-next-line:no-console
console.debug(e);
return;
}
return;
}
}