git ssb

3+

cel / ssb-npm-registry



Commit 257cfa8e8dc77dd00e22c248de7e22a51c630528

Handle license property in package link

cel committed on 9/3/2018, 2:13:37 AM
Parent: 1d78bcde8d9f2130394a1832348d805fe9b77467

Files changed

index.jschanged
index.jsView
@@ -1073,18 +1073,19 @@
10731073
10741074 Req.prototype.populatePackageJson = function (obj, cb) {
10751075 var self = this
10761076 var blobId = obj.dist.tarball.replace(/.*\/blobs\/get\//, '')
1077- var deps, bundledDeps, shasum
1077 + var deps, bundledDeps, shasum, license
10781078
1079- // look for dependencies in links.
1079 + // look for dependencies and other properties in links.
10801080 // then fallback to getting it from the tarball blob
10811081
10821082 pull(
10831083 self.getMentionLinks(blobId),
10841084 pull.drain(function (link) {
10851085 if (link.dependencies) deps = link.dependencies
10861086 if (link.shasum) shasum = link.shasum
1087 + if (link.license) license = link.license
10871088 bundledDeps = link.bundledDependencies || link.bundleDependencies || bundledDeps
10881089 // how to handle multiple assignments of dependencies to a package?
10891090 }, function (err) {
10901091 if (err) return cb(new Error(err.stack || err))
@@ -1092,8 +1093,9 @@
10921093 // assume that the dependencies in the links to the blob are
10931094 // correct.
10941095 obj.dependencies = deps
10951096 obj.bundledDependencies = bundledDeps
1097 + obj.license = license
10961098 if (shasum) obj.dist.shasum = obj._shasum = shasum
10971099 next(obj)
10981100 } else {
10991101 // get dependencies from the tarball

Built with git-ssb-web