refactor: throw if el not found

This commit is contained in:
Miodec 2023-09-27 11:52:10 +01:00
parent cf1c93f551
commit e9c4512fa6

View file

@ -3,6 +3,7 @@ const skeletons = new Map<string, HTMLElement>();
export function save(id: string, removeAfter = true): void {
const el = document.getElementById(id) as HTMLElement;
if (!el) throw new Error(`Element with id ${id} not found`);
skeletons.set(id, el);
if (removeAfter) remove(id);
}