nav tabs on admin dashboard
This commit is contained in:
14
node_modules/yargs/lib/levenshtein.js
generated
vendored
14
node_modules/yargs/lib/levenshtein.js
generated
vendored
@@ -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
|
||||
}
|
||||
@@ -37,8 +37,8 @@ module.exports = function (a, b) {
|
||||
matrix[i][j] = matrix[i - 1][j - 1]
|
||||
} else {
|
||||
matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
|
||||
Math.min(matrix[i][j - 1] + 1, // insertion
|
||||
matrix[i - 1][j] + 1)) // deletion
|
||||
Math.min(matrix[i][j - 1] + 1, // insertion
|
||||
matrix[i - 1][j] + 1)) // deletion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user