Rocky_Mountain_Vending/.pnpm-store/v10/files/b1/e5f1c8f08a1481f2549142e7b90e611116c6b8076cd9450080542fbe2d0a6d0dcac40d7064cf07ce767a7aefcf4d637371ded9eee92dfe176c2c0b5aa250a1
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

69 lines
1.8 KiB
Text

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/**
* The key used to store the local variables on the error object.
*/
const LOCAL_VARIABLES_KEY = '__SENTRY_ERROR_LOCAL_VARIABLES__';
/**
* Creates a rate limiter that will call the disable callback when the rate limit is reached and the enable callback
* when a timeout has occurred.
* @param maxPerSecond Maximum number of calls per second
* @param enable Callback to enable capture
* @param disable Callback to disable capture
* @returns A function to call to increment the rate limiter count
*/
function createRateLimiter(
maxPerSecond,
enable,
disable,
) {
let count = 0;
let retrySeconds = 5;
let disabledTimeout = 0;
setInterval(() => {
if (disabledTimeout === 0) {
if (count > maxPerSecond) {
retrySeconds *= 2;
disable(retrySeconds);
// Cap at one day
if (retrySeconds > 86400) {
retrySeconds = 86400;
}
disabledTimeout = retrySeconds;
}
} else {
disabledTimeout -= 1;
if (disabledTimeout === 0) {
enable();
}
}
count = 0;
}, 1000).unref();
return () => {
count += 1;
};
}
// Add types for the exception event data
/** Could this be an anonymous function? */
function isAnonymous(name) {
return name !== undefined && (name.length === 0 || name === '?' || name === '<anonymous>');
}
/** Do the function names appear to match? */
function functionNamesMatch(a, b) {
return a === b || `Object.${a}` === b || a === `Object.${b}` || (isAnonymous(a) && isAnonymous(b));
}
exports.LOCAL_VARIABLES_KEY = LOCAL_VARIABLES_KEY;
exports.createRateLimiter = createRateLimiter;
exports.functionNamesMatch = functionNamesMatch;
exports.isAnonymous = isAnonymous;
//# sourceMappingURL=common.js.map