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.
1 parent d72a756 commit 2e1bbd7Copy full SHA for 2e1bbd7
1 file changed
app/components/Package/LikeCard.vue
@@ -8,8 +8,7 @@ const props = defineProps<{
8
const compactNumberFormatter = useCompactNumberFormatter()
9
10
function extractPackageFromRef(ref: string) {
11
- const { pkg } = /https:\/\/npmx.dev\/package\/(?<pkg>.*)/.exec(ref).groups
12
- return pkg
+ return /https:\/\/npmx.dev\/package\/(?<pkg>.*)/.exec(ref)?.groups?.pkg ?? ref
13
}
14
15
const name = computed(() => extractPackageFromRef(props.packageUrl))
0 commit comments