[Pkg-javascript-commits] [node-yarnpkg] 01/03: replace dependency on leven with fast-levenshtein

Paolo Greppi paolog-guest at moszumanska.debian.org
Sun Dec 25 07:34:48 UTC 2016


This is an automated email from the git hooks/post-receive script.

paolog-guest pushed a commit to branch master
in repository node-yarnpkg.

commit 5f1c9fe9dd49193d41dec2f5e961e40f29ee1549
Author: Paolo Greppi <paolo.greppi at libpf.com>
Date:   Sun Dec 25 07:10:05 2016 +0000

    replace dependency on leven with fast-levenshtein
---
 debian/control               |  2 +-
 debian/patches/03-leven.diff | 27 +++++++++++++++++++++++++++
 debian/patches/series        |  1 +
 3 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index bb3f44d..b3f4732 100644
--- a/debian/control
+++ b/debian/control
@@ -32,7 +32,7 @@ Depends:
  , node-inquirer (>= 1.2.2)
  , node-invariant (>= 2.2.0)
  , node-is-builtin-module (>= 1.0.0)
- , node-leven (>= 2.0.0)
+ , node-fast-levenshtein
  , node-loud-rejection (>= 1.2.0)
  , node-minimatch (>= 3.0.3)
  , node-mkdirp (>= 0.5.1)
diff --git a/debian/patches/03-leven.diff b/debian/patches/03-leven.diff
new file mode 100644
index 0000000..d834de0
--- /dev/null
+++ b/debian/patches/03-leven.diff
@@ -0,0 +1,27 @@
+Description: Replace dependency on leven with fast-levenshtein.
+ The latter is available as a Debian package.
+Forwarded: not-needed
+Author: Paolo Greppi <paolo.greppi at libpf.com>
+
+Index: node-yarnpkg/src/cli/commands/run.js
+===================================================================
+--- node-yarnpkg.orig/src/cli/commands/run.js
++++ node-yarnpkg/src/cli/commands/run.js
+@@ -17,7 +17,7 @@ import {registries} from '../../resolver
+ import * as fs from '../../util/fs.js';
+ import map from '../../util/map.js';
+ 
+-const leven = require('leven');
++const levenshtein = require('fast-levenshtein');
+ const path = require('path');
+ 
+ export async function run(
+@@ -73,7 +73,7 @@ export async function run(
+       let suggestion;
+ 
+       for (const commandName in scripts) {
+-        const steps = leven(commandName, action);
++        const steps = levenshtein.get(commandName, action);
+         if (steps < 2) {
+           suggestion = commandName;
+         }
diff --git a/debian/patches/series b/debian/patches/series
index 36ac9ee..ff1f16f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 00-nodejs.diff
 01-cmd-shim.diff
 02-is-ci.diff
+03-leven.diff

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-yarnpkg.git



More information about the Pkg-javascript-commits mailing list