Rocky_Mountain_Vending/.pnpm-store/v10/files/74/d7ae984c501166c353b07b8842d0d2ec8e24f14ab560b2eaebed04b817b5ca25e9996bda54c772b8e3a969dc2ef40d127d279163ff4d764de17481e0b2e032
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
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>
2026-02-12 16:22:15 -07:00

22 lines
664 B
Text

/**
* Parse a sample rate from a given value.
* This will either return a boolean or number sample rate, if the sample rate is valid (between 0 and 1).
* If a string is passed, we try to convert it to a number.
*
* Any invalid sample rate will return `undefined`.
*/
function parseSampleRate(sampleRate) {
if (typeof sampleRate === 'boolean') {
return Number(sampleRate);
}
const rate = typeof sampleRate === 'string' ? parseFloat(sampleRate) : sampleRate;
if (typeof rate !== 'number' || isNaN(rate) || rate < 0 || rate > 1) {
return undefined;
}
return rate;
}
export { parseSampleRate };
//# sourceMappingURL=parseSampleRate.js.map