Skip to content

Commit 39259f4

Browse files
committed
chore: check url existence only
1 parent 26feb38 commit 39259f4

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/composables/npm/usePackage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function transformPackument(
125125
const rawStorybook = requestedPkgVersion?.storybook
126126
const storybook =
127127
rawStorybook && typeof rawStorybook === 'object' && 'url' in rawStorybook
128-
? (rawStorybook as { title?: string; url: string })
128+
? ({ url: rawStorybook.url } as { url: string })
129129
: undefined
130130

131131
return {

app/pages/package/[[org]]/[name].vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const { data: readmeData } = useLazyFetch<ReadmeResponse>(
112112
const playgroundLinks = computed(() => [
113113
...readmeData.value.playgroundLinks,
114114
// Libraries with a storybook field in package.json contain a link to their deployed playground
115-
...(pkg.value?.storybook
115+
...(pkg.value?.storybook?.url
116116
? [
117117
{
118118
url: pkg.value.storybook.url,

shared/types/npm-registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export interface SlimPackument {
8383
'keywords'?: string[]
8484
'repository'?: { type?: string; url?: string; directory?: string }
8585
'bugs'?: { url?: string; email?: string }
86-
'storybook'?: { title?: string; url: string }
86+
'storybook'?: { url: string }
8787
/** current version */
8888
'requestedVersion': SlimPackumentVersion | null
8989
/** Only includes dist-tag versions (with installScripts info added per version) */

0 commit comments

Comments
 (0)