File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ function getTrustLevel(version: PackumentVersion): PublishTrustLevel {
1717}
1818
1919function normalizeLicense ( license ?: PackumentLicense ) : string | undefined {
20- if ( license && typeof license === 'object' && 'type' in license ) {
21- return license . type
22- }
23- return typeof license === 'string' ? license : undefined
20+ if ( ! license ) return undefined
21+ if ( typeof license === 'string' ) return license
22+ if ( typeof license . type === 'string' ) return license . type
23+ return undefined
2424}
2525
2626/**
@@ -116,7 +116,7 @@ export function transformPackument(
116116 }
117117
118118 // Normalize license field
119- const license = normalizeLicense ( versionData ?. license || pkg . license )
119+ const license = normalizeLicense ( requestedVersion ? versionData ?. license : pkg . license )
120120
121121 // Extract storybook field from the requested version (custom package.json field)
122122 const requestedPkgVersion = requestedVersion ? pkg . versions [ requestedVersion ] : null
You can’t perform that action at this time.
0 commit comments