mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
fix: adds _id to normalise metadata (#1194)
This commit is contained in:
parent
056d396b59
commit
e2fa581644
1 changed files with 5 additions and 1 deletions
|
@ -53,6 +53,10 @@ function normalizePackage(pkg: Package) {
|
|||
pkg._rev = DEFAULT_REVISION;
|
||||
}
|
||||
|
||||
if (_.isString(pkg._id) === false) {
|
||||
pkg._id = pkg.name;
|
||||
}
|
||||
|
||||
// normalize dist-tags
|
||||
normalizeDistTags(pkg);
|
||||
|
||||
|
@ -107,7 +111,7 @@ export function normalizeContributors(contributors: Array<Author>): Array<Author
|
|||
return contributors;
|
||||
}
|
||||
|
||||
export const WHITELIST = ['_rev', 'name', 'versions', 'dist-tags', 'readme', 'time'];
|
||||
export const WHITELIST = ['_rev', 'name', 'versions', 'dist-tags', 'readme', 'time', '_id'];
|
||||
|
||||
export function cleanUpLinksRef(keepUpLinkData: boolean, result: Package): Package {
|
||||
const propertyToKeep = [...WHITELIST];
|
||||
|
|
Loading…
Reference in a new issue