mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2025-09-08 15:57:21 +00:00
push all website files
This commit is contained in:
17
website/node_modules/npm/lib/utils/did-you-mean.js
generated
vendored
Normal file
17
website/node_modules/npm/lib/utils/did-you-mean.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
var meant = require('meant')
|
||||
|
||||
function didYouMean (scmd, commands) {
|
||||
var bestSimilarity = meant(scmd, commands).map(function (str) {
|
||||
return ' ' + str
|
||||
})
|
||||
|
||||
if (bestSimilarity.length === 0) return ''
|
||||
if (bestSimilarity.length === 1) {
|
||||
return '\nDid you mean this?\n' + bestSimilarity[0]
|
||||
} else {
|
||||
return ['\nDid you mean one of these?']
|
||||
.concat(bestSimilarity.slice(0, 3)).join('\n')
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = didYouMean
|
Reference in New Issue
Block a user