0
Fork 0
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:
Ayush Sharma 2019-01-21 22:08:07 +01:00
parent 056d396b59
commit e2fa581644

View file

@ -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];