diff options
Diffstat (limited to 'deps/npm/lib/utils/did-you-mean.js')
-rw-r--r-- | deps/npm/lib/utils/did-you-mean.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/deps/npm/lib/utils/did-you-mean.js b/deps/npm/lib/utils/did-you-mean.js index 8e72dde5fa..479f04755d 100644 --- a/deps/npm/lib/utils/did-you-mean.js +++ b/deps/npm/lib/utils/did-you-mean.js @@ -1,19 +1,16 @@ var meant = require('meant') -var output = require('./output.js') function didYouMean (scmd, commands) { var bestSimilarity = meant(scmd, commands).map(function (str) { return ' ' + str }) - if (bestSimilarity.length === 0) return + if (bestSimilarity.length === 0) return '' if (bestSimilarity.length === 1) { - output('\nDid you mean this?\n' + bestSimilarity[0]) + return '\nDid you mean this?\n' + bestSimilarity[0] } else { - output( - ['\nDid you mean one of these?'] - .concat(bestSimilarity.slice(0, 3)).join('\n') - ) + return ['\nDid you mean one of these?'] + .concat(bestSimilarity.slice(0, 3)).join('\n') } } |