Files
supabase/apps/ui-library/public/r/safe-next-path.json
T
Ivan Vasilov 7fd37e6150 chore: Bump shadcn (#50517)
This PR bumps `shadcn` and regenerates all blocks with the latest CLI.
The blocks have no meaningful change (only a json property reorder).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Updated internal development tooling used by the UI library and Vue
blocks.
* **Tests**
* Improved type consistency in registry-related test utilities,
supporting more reliable validation without changing user-facing
behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-18 10:38:49 +10:00

17 lines
880 B
JSON

{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "safe-next-path",
"title": "Safe next path",
"description": "Validates same-origin paths before redirecting.",
"dependencies": [],
"registryDependencies": [],
"files": [
{
"path": "registry/default/blocks/safe-next-path/lib/safe-next-path.ts",
"content": "export const safeNextPath = (path: unknown, fallback = '/', origin?: string) => {\n if (typeof path !== 'string' || !path.startsWith('/')) return fallback\n\n const currentOrigin = origin ?? window.location.origin\n\n try {\n const url = new URL(path, currentOrigin)\n return url.origin === currentOrigin ? `${url.pathname}${url.search}${url.hash}` : fallback\n } catch {\n return fallback\n }\n}\n",
"type": "registry:lib",
"target": "lib/safe-next-path.ts"
}
],
"type": "registry:lib"
}