Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYash Singh <saiansh2525@gmail.com>2021-04-08 20:56:34 +0300
committerGar <gar+gh@danger.computer>2021-04-14 19:42:51 +0300
commitf9b639eb6c504ded6cdd59e83e26a392bfe81e5d (patch)
tree997ad7d8ddb8e281128602795b137426a04112d0 /lib/bugs.js
parent58914be753e769c534aecc64b5c1883d195cd6dd (diff)
feat(bugs): fall back to email if provided
If a bugs url is not provided, but a `mailto` is, then that is used. PR-URL: https://github.com/npm/cli/pull/3052 Credit: @Yash-Singh1 Close: #3052 Reviewed-by: @wraithgar
Diffstat (limited to 'lib/bugs.js')
-rw-r--r--lib/bugs.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/bugs.js b/lib/bugs.js
index a0cef4c5e..5085a25b4 100644
--- a/lib/bugs.js
+++ b/lib/bugs.js
@@ -43,6 +43,9 @@ class Bugs extends BaseCommand {
if (typeof mani.bugs === 'object' && mani.bugs.url)
return mani.bugs.url
+
+ if (typeof mani.bugs === 'object' && mani.bugs.email)
+ return `mailto:${mani.bugs.email}`
}
// try to get it from the repo, if possible