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>
34 lines
941 B
Text
34 lines
941 B
Text
"use strict";
|
|
/**
|
|
* https://tc39.es/ecma402/#sec-getstringorbooleanoption
|
|
* @param opts
|
|
* @param prop
|
|
* @param values
|
|
* @param trueValue
|
|
* @param falsyValue
|
|
* @param fallback
|
|
*/
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.GetStringOrBooleanOption = GetStringOrBooleanOption;
|
|
var _262_1 = require("./262");
|
|
function GetStringOrBooleanOption(opts, prop, values, trueValue, falsyValue, fallback) {
|
|
var value = opts[prop];
|
|
if (value === undefined) {
|
|
return fallback;
|
|
}
|
|
if (value === true) {
|
|
return trueValue;
|
|
}
|
|
var valueBoolean = Boolean(value);
|
|
if (valueBoolean === false) {
|
|
return falsyValue;
|
|
}
|
|
value = (0, _262_1.ToString)(value);
|
|
if (value === 'true' || value === 'false') {
|
|
return fallback;
|
|
}
|
|
if ((values || []).indexOf(value) === -1) {
|
|
throw new RangeError("Invalid value ".concat(value));
|
|
}
|
|
return value;
|
|
}
|