We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d31ccf3 commit 336d016Copy full SHA for 336d016
packages/svelte/src/compiler/phases/1-parse/utils/fuzzymatch.js
@@ -33,11 +33,7 @@ function _distance(str1, str2) {
33
str2 = String(str2);
34
35
const distance = levenshtein(str1, str2);
36
- if (str1.length > str2.length) {
37
- return 1 - distance / str1.length;
38
- } else {
39
- return 1 - distance / str2.length;
40
- }
+ return 1 - distance / Math.max(str1.length, str2.length);
41
}
42
43
// helper functions
0 commit comments