1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
Description: Replace dependency on leven with fast-levenshtein.
The latter is available as a Debian package.
Forwarded: not-needed
Author: Paolo Greppi <paolo.greppi@libpf.com>
--- a/src/cli/commands/run.js
+++ b/src/cli/commands/run.js
@@ -10,7 +10,7 @@
import * as constants from '../../constants.js';
const invariant = require('invariant');
-const leven = require('leven');
+const levenshtein = require('fast-levenshtein');
const path = require('path');
const {quoteForShell, sh, unquoted} = require('puka');
@@ -139,7 +139,7 @@
let suggestion;
for (const commandName in scripts) {
- const steps = leven(commandName, action);
+ const steps = levenshtein.get(commandName, action);
if (steps < 2) {
suggestion = commandName;
}
|