aboutsummaryrefslogtreecommitdiff
path: root/node_modules/yargs/lib/levenshtein.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-12-10 21:51:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-12-10 21:51:33 +0100
commit0469abd4a9c9270a1fdc962969e36e63699af8b4 (patch)
treef9864d4a4148621378958794cbbfdc2393733283 /node_modules/yargs/lib/levenshtein.js
parent6947e79bbc258f7bc96af424ddb71a511f0c15a3 (diff)
upgrade dependencies
Diffstat (limited to 'node_modules/yargs/lib/levenshtein.js')
-rw-r--r--node_modules/yargs/lib/levenshtein.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/node_modules/yargs/lib/levenshtein.js b/node_modules/yargs/lib/levenshtein.js
index 6ec216f59..f32b0c277 100644
--- a/node_modules/yargs/lib/levenshtein.js
+++ b/node_modules/yargs/lib/levenshtein.js
@@ -10,22 +10,22 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// levenshtein distance algorithm, pulled from Andrei Mackenzie's MIT licensed.
// gist, which can be found here: https://gist.github.com/andrei-m/982927
-
+'use strict'
// Compute the edit distance between the two given strings
-module.exports = function (a, b) {
+module.exports = function levenshtein (a, b) {
if (a.length === 0) return b.length
if (b.length === 0) return a.length
- var matrix = []
+ const matrix = []
// increment along the first column of each row
- var i
+ let i
for (i = 0; i <= b.length; i++) {
matrix[i] = [i]
}
// increment each column in the first row
- var j
+ let j
for (j = 0; j <= a.length; j++) {
matrix[0][j] = j
}