blob: a3a1765b568561042f9a791ff8e3c98c4ad94194 (
plain) (
blame)
1
2
3
4
|
export const requireElement = <T extends Element>(element: T | null, description: string): T => {
if (!element) throw new Error(`Missing ${description} element`);
return element;
};
|