summaryrefslogtreecommitdiff
path: root/deps/npm/lib
diff options
context:
space:
mode:
authorclaudiahdz <cghr1990@gmail.com>2019-11-18 21:01:39 +0200
committerMyles Borins <mylesborins@google.com>2019-11-20 19:16:47 -0500
commita7c7c703aff362f06ef5d49451a0f79fd289910f (patch)
tree48f9d01b32d55d420f229c4889a5a61178419223 /deps/npm/lib
parenta30a9f8193ddd61dfadc2d5d79784b682027b319 (diff)
downloadandroid-node-v8-a7c7c703aff362f06ef5d49451a0f79fd289910f.tar.gz
android-node-v8-a7c7c703aff362f06ef5d49451a0f79fd289910f.tar.bz2
android-node-v8-a7c7c703aff362f06ef5d49451a0f79fd289910f.zip
deps: upgrade npm to 6.13.1
PR-URL: https://github.com/nodejs/node/pull/30533 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/npm/lib')
-rw-r--r--deps/npm/lib/install.js8
-rw-r--r--deps/npm/lib/install/fund.js4
-rw-r--r--deps/npm/lib/utils/funding.js18
3 files changed, 19 insertions, 11 deletions
diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js
index a4cf2b186d..378ada7b05 100644
--- a/deps/npm/lib/install.js
+++ b/deps/npm/lib/install.js
@@ -26,6 +26,7 @@ install.usage = usage(
'\nnpm install [<@scope>/]<pkg>@<tag>' +
'\nnpm install [<@scope>/]<pkg>@<version>' +
'\nnpm install [<@scope>/]<pkg>@<version range>' +
+ '\nnpm install <alias>@npm:<name>' +
'\nnpm install <folder>' +
'\nnpm install <tarball file>' +
'\nnpm install <tarball url>' +
@@ -877,9 +878,6 @@ Installer.prototype.printInstalledForHuman = function (diffs, auditResult) {
report += ' in ' + ((Date.now() - this.started) / 1000) + 's'
output(report)
- if (auditResult) {
- audit.printInstallReport(auditResult)
- }
function packages (num) {
return num + ' package' + (num > 1 ? 's' : '')
@@ -910,6 +908,10 @@ Installer.prototype.printInstalledForHuman = function (diffs, auditResult) {
if (printFundingReport.length) {
output(printFundingReport)
}
+
+ if (auditResult) {
+ return audit.printInstallReport(auditResult)
+ }
}
Installer.prototype.printInstalledForJSON = function (diffs, auditResult) {
diff --git a/deps/npm/lib/install/fund.js b/deps/npm/lib/install/fund.js
index 55a167a955..809c05b338 100644
--- a/deps/npm/lib/install/fund.js
+++ b/deps/npm/lib/install/fund.js
@@ -39,8 +39,8 @@ function getPrintFundingReport ({ fund, idealTree }, opts) {
return padding('') + length + ' ' +
packageQuantity(length) +
- ' looking for funding.' +
- padding('Run "npm fund" to find out more.')
+ ' looking for funding' +
+ padding(' run `npm fund` for details\n')
}
function getPrintFundingReportJSON ({ fund, idealTree }) {
diff --git a/deps/npm/lib/utils/funding.js b/deps/npm/lib/utils/funding.js
index 2c994e0b6b..dce4014764 100644
--- a/deps/npm/lib/utils/funding.js
+++ b/deps/npm/lib/utils/funding.js
@@ -8,12 +8,10 @@ exports.validFundingUrl = validFundingUrl
// Is the value of a `funding` property of a `package.json`
// a valid type+url for `npm fund` to display?
function validFundingUrl (funding) {
- if (!funding || !funding.url) {
- return false
- }
+ if (!funding) return false
try {
- var parsed = new URL(funding.url)
+ var parsed = new URL(funding.url || funding)
} catch (error) {
return false
}
@@ -62,6 +60,14 @@ function getFundingInfo (idealTree, opts) {
)
}
+ function retrieveFunding (funding) {
+ return typeof funding === 'string'
+ ? {
+ url: funding
+ }
+ : funding
+ }
+
function getFundingDependencies (tree) {
const deps = tree && tree.dependencies
if (!deps) return empty()
@@ -82,7 +88,7 @@ function getFundingInfo (idealTree, opts) {
}
if (funding && validFundingUrl(funding)) {
- fundingItem.funding = funding
+ fundingItem.funding = retrieveFunding(funding)
length++
}
@@ -134,7 +140,7 @@ function getFundingInfo (idealTree, opts) {
}
if (idealTree && idealTree.funding) {
- result.funding = idealTree.funding
+ result.funding = retrieveFunding(idealTree.funding)
}
result.dependencies =