Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions app/utils/router.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
export function packageRoute(packageName: string, version?: string | null) {
const [org, name] = packageName.startsWith('@') ? packageName.split('/') : [null, packageName]
import type { RouteLocationRaw } from 'vue-router'

export function packageRoute(packageName: string, version?: string | null): RouteLocationRaw {
const [org, name] = packageName.startsWith('@')
? (packageName.split('/') as [string, string])
: ['', packageName]
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

if (version) {
return {
name: 'package-version' as const,
name: 'package-version',
params: {
org,
name,
Expand All @@ -13,7 +17,7 @@ export function packageRoute(packageName: string, version?: string | null) {
}

return {
name: 'package' as const,
name: 'package',
params: {
org,
name,
Expand Down
Loading