Skip to content

Commit

Permalink
chore: Use fastest-levenshtein instead of leven (#1641)
Browse files Browse the repository at this point in the history
  • Loading branch information
ka-weihe committed Aug 3, 2020
1 parent 70551f9 commit 99d8806
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -44,6 +44,7 @@
"es6-promise": "^4.2.8",
"escodegen": "^1.12.0",
"estree-walker": "~0.9.0",
"fastest-levenshtein": "^1.0.9",
"findup": "^0.1.5",
"function.name-polyfill": "^1.0.6",
"github-slugger": "^1.2.1",
Expand All @@ -60,7 +61,6 @@
"jss-plugin-isolate": "^10.0.0",
"jss-plugin-nested": "^10.0.0",
"kleur": "^3.0.3",
"leven": "^3.1.0",
"listify": "^1.0.0",
"loader-utils": "^2.0.0",
"lodash": "^4.17.15",
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/utils/sanitizeConfig.ts
Expand Up @@ -10,7 +10,7 @@ import isFinite from 'lodash/isFinite';
import map from 'lodash/map';
import listify from 'listify';
import kleur from 'kleur';
import leven from 'leven';
import { distance } from 'fastest-levenshtein';
import typeDetect from 'type-detect';
import loggerMaker from 'glogg';
import { stringify } from 'q-i';
Expand Down Expand Up @@ -57,7 +57,7 @@ export default function sanitizeConfig<T extends Record<string, any>>(
// Try to guess
const possibleOptions = Object.keys(schema);
const suggestedOption = possibleOptions.reduce((suggestion: string, option: string) => {
const steps = leven(option, key);
const steps = distance(option, key);
if (steps < 2) {
return option;
}
Expand Down

0 comments on commit 99d8806

Please sign in to comment.