nav tabs on admin dashboard

This commit is contained in:
2019-03-07 00:20:34 -06:00
parent f73d6ae228
commit e4f473f376
11661 changed files with 216240 additions and 1544253 deletions

View File

@@ -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
}
}
}