diff options
author | npm team <ops+robot@npmjs.com> | 2021-11-04 20:42:47 +0000 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2021-11-10 16:48:41 -0800 |
commit | 6e1629786fe16058e0f12bc1613fae7734bff9b0 (patch) | |
tree | b12c45383e9960fad1d0ee1fb7ba765a2e53ffed /deps/npm/lib/utils/did-you-mean.js | |
parent | fc4a7927288048089eaa6bf55177d7b4a3463609 (diff) | |
download | node-new-6e1629786fe16058e0f12bc1613fae7734bff9b0.tar.gz |
deps: upgrade npm to 8.1.3
PR-URL: https://github.com/nodejs/node/pull/40726
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'deps/npm/lib/utils/did-you-mean.js')
-rw-r--r-- | deps/npm/lib/utils/did-you-mean.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/deps/npm/lib/utils/did-you-mean.js b/deps/npm/lib/utils/did-you-mean.js index c324253af2..9530483098 100644 --- a/deps/npm/lib/utils/did-you-mean.js +++ b/deps/npm/lib/utils/did-you-mean.js @@ -3,10 +3,14 @@ const readJson = require('read-package-json-fast') const { cmdList } = require('./cmd-list.js') const didYouMean = async (npm, path, scmd) => { - let best = cmdList + // const cmd = await npm.cmd(str) + const close = cmdList .filter(cmd => distance(scmd, cmd) < scmd.length * 0.4 && scmd !== cmd) - .map(str => ` npm ${str} # ${npm.commands[str].description}`) - + let best = [] + for (const str of close) { + const cmd = await npm.cmd(str) + best.push(` npm ${str} # ${cmd.description}`) + } // We would already be suggesting this in `npm x` so omit them here const runScripts = ['stop', 'start', 'test', 'restart'] try { |