export const requireElement = (element: T | null, description: string): T => { if (!element) throw new Error(`Missing ${description} element`); return element; };