diff --git a/src/package-managers/npm.ts b/src/package-managers/npm.ts index 2fde0c50..6de6233c 100644 --- a/src/package-managers/npm.ts +++ b/src/package-managers/npm.ts @@ -298,7 +298,7 @@ export const mockViewMany = }, version, // overwritten below - versions: [], + versions: {}, ...(isPackument(partialPackument) ? partialPackument : null), } @@ -315,7 +315,9 @@ export const mockViewMany = } as Index) : ({ ...packument, - versions: [packument], + versions: { + [version]: packument, + }, } as Packument), })), ) diff --git a/src/types/Packument.ts b/src/types/Packument.ts index 99bcea4a..f04d6064 100644 --- a/src/types/Packument.ts +++ b/src/types/Packument.ts @@ -3,6 +3,9 @@ import { Version } from './Version' /** A pacote packument result object. */ export interface Packument { + _npmUser?: { + name: string + } name: string deprecated?: boolean engines: { @@ -12,5 +15,5 @@ export interface Packument { // TODO: store only the time of the latest version? time?: Index version: Version - versions: Packument[] + versions: Index }