We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
name
1 parent 0da0408 commit a8a1e92Copy full SHA for a8a1e92
1 file changed
app/utils/router.ts
@@ -1,9 +1,7 @@
1
import type { RouteLocationRaw } from 'vue-router'
2
3
export function packageRoute(packageName: string, version?: string | null): RouteLocationRaw {
4
- const [org, name] = packageName.startsWith('@')
5
- ? (packageName.split('/') as [string, string])
6
- : ['', packageName]
+ const [org, name = ''] = packageName.startsWith('@') ? packageName.split('/') : ['', packageName]
7
8
if (version) {
9
return {
0 commit comments