Rocky_Mountain_Vending/.pnpm-store/v10/files/6e/be5e4c0a2c15994076a03dbe4e1011d0aef40aea69d30e87c6ef572ad405f6c8a308fb8d0c84836a892cbe39cbaeb66cff3ceb41a576b5a690ab92d7c533c7
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

26 lines
No EOL
1.1 KiB
Text

import { RedirectStatusCode } from './redirect-status-code';
export const REDIRECT_ERROR_CODE = 'NEXT_REDIRECT';
export var RedirectType = /*#__PURE__*/ function(RedirectType) {
RedirectType["push"] = "push";
RedirectType["replace"] = "replace";
return RedirectType;
}({});
/**
* Checks an error to determine if it's an error generated by the
* `redirect(url)` helper.
*
* @param error the error that may reference a redirect error
* @returns true if the error is a redirect error
*/ export function isRedirectError(error) {
if (typeof error !== 'object' || error === null || !('digest' in error) || typeof error.digest !== 'string') {
return false;
}
const digest = error.digest.split(';');
const [errorCode, type] = digest;
const destination = digest.slice(2, -2).join(';');
const status = digest.at(-2);
const statusCode = Number(status);
return errorCode === REDIRECT_ERROR_CODE && (type === 'replace' || type === 'push') && typeof destination === 'string' && !isNaN(statusCode) && statusCode in RedirectStatusCode;
}
//# sourceMappingURL=redirect-error.js.map