Skip to content

Commit

Permalink
Lower the fast-levenshtein dep, to a similar version as the current d…
Browse files Browse the repository at this point in the history
…ep tree, and copy TypeScript's rules for min distance
  • Loading branch information
orta committed Jul 30, 2020
1 parent ebe921a commit d142e86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/helpers/normalizeArgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ function similarTasks(registry, queryTask) {
for (var task in tasks) {
if (tasks.hasOwnProperty(task)) {
var distance = levenshtein.get(task, queryTask);
if (distance < 3) {
var allowedDistance = Math.floor(0.4 * task.length) + 1;
if (distance < allowedDistance) {
similarTasks.push(task);
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"object.defaults": "^1.0.0",
"object.reduce": "^1.0.0",
"undertaker-registry": "^1.0.0",
"fast-levenshtein": "^3.0.0"
"fast-levenshtein": "^1.0.0"
},
"devDependencies": {
"async-once": "^1.0.0",
Expand Down

0 comments on commit d142e86

Please sign in to comment.