Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
9 lines
306 B
Text
9 lines
306 B
Text
export const booleanSelector = (obj, key, type) => {
|
|
if (!(key in obj))
|
|
return undefined;
|
|
if (obj[key] === "true")
|
|
return true;
|
|
if (obj[key] === "false")
|
|
return false;
|
|
throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`);
|
|
};
|