···152152 severity: vulnsSeverity,
153153 },
154154 metadata: {
155155- license: pkgData.license,
155155+ license:
156156+ typeof pkgData.license === 'object' && 'type' in pkgData.license
157157+ ? pkgData.license.type
158158+ : pkgData.license,
156159 // Use version-specific publish time, NOT time.modified (which can be
157160 // updated by metadata changes like maintainer additions)
158161 lastUpdated: pkgData.time?.[latestVersion],
+8-8
shared/types/npm-registry.ts
···66 * @see https://github.com/npm/registry/blob/main/docs/REGISTRY-API.md
77 */
8899-import type { PackumentVersion } from '@npm/types'
99+import type { Packument as PackumentWithoutLicenseObjects, PackumentVersion } from '@npm/types'
1010import type { ReadmeResponse } from './readme'
11111212// Re-export official npm types for packument/manifest
1313-export type {
1414- Packument,
1515- PackumentVersion,
1616- Manifest,
1717- ManifestVersion,
1818- PackageJSON,
1919-} from '@npm/types'
1313+export type { PackumentVersion, Manifest, ManifestVersion, PackageJSON } from '@npm/types'
1414+1515+// TODO: Remove this type override when @npm/types fixes the license field typing
1616+export type Packument = Omit<PackumentWithoutLicenseObjects, 'license'> & {
1717+ // Fix for license field being incorrectly typed in @npm/types
1818+ license?: string | { type: string; url?: string }
1919+}
20202121/** Install scripts info (preinstall, install, postinstall) */
2222export interface InstallScriptsInfo {