From 47640eb2c3cd9891e904e3f6bc705b6618096103 Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 23 Oct 2020 11:15:35 -0700 Subject: update lint rules to match @npmcli/arborist --- lib/bugs.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'lib/bugs.js') diff --git a/lib/bugs.js b/lib/bugs.js index e6940f36b..012f39efb 100644 --- a/lib/bugs.js +++ b/lib/bugs.js @@ -12,27 +12,25 @@ const completion = require('./utils/completion/none.js') const cmd = (args, cb) => bugs(args).then(() => cb()).catch(cb) const bugs = async args => { - if (!args || !args.length) { + if (!args || !args.length) args = ['.'] - } + await Promise.all(args.map(pkg => getBugs(pkg))) } const getBugsUrl = mani => { if (mani.bugs) { - if (typeof mani.bugs === 'string') { + if (typeof mani.bugs === 'string') return mani.bugs - } - if (typeof mani.bugs === 'object' && mani.bugs.url) { + + if (typeof mani.bugs === 'object' && mani.bugs.url) return mani.bugs.url - } } // try to get it from the repo, if possible const info = hostedFromMani(mani) - if (info) { + if (info) return info.bugs() - } // just send them to the website, hopefully that has some info! return `https://www.npmjs.com/package/${mani.name}` -- cgit v1.2.3