0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-20 22:52:46 -05:00

Merge pull request #1200 from verdaccio/1194-npm-show-package-name

fix: adds _id to normalize metadata (#1194)
This commit is contained in:
Juan Picado @jotadeveloper 2019-01-22 07:13:23 +01:00 committed by GitHub
commit e36bd6cba9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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