Skip to content

Commit

Permalink
Merge pull request #35794 from dimagi/dependabot/npm_and_yarn/fast-le…
Browse files Browse the repository at this point in the history
…venshtein-3.0.0

Bump fast-levenshtein from 2.0.6 to 3.0.0
  • Loading branch information
orangejenny authored Feb 18, 2025
2 parents 80e368e + d12772a commit 2390642
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import initialPageData from "hqwebapp/js/initial_page_data";
import * as fixtures from "cloudcare/js/form_entry/spec/fixtures";
import formUI from "cloudcare/js/form_entry/form_ui";
import utils from "cloudcare/js/form_entry/utils";
import Levenshtein from "fast-levenshtein/levenshtein";

describe('Formplayer utils', function () {
it('Should determine if two answers are equal', function () {
Expand Down Expand Up @@ -58,4 +59,12 @@ describe('Formplayer utils', function () {

initialPageData.unregister("toggles_dict");
});

it('Should verify basic Levenshtein calculations for use in comboboxes', function () {
assert.equal(Levenshtein.get("mark", "mark"), 0);
assert.equal(Levenshtein.get("mark", "mar"), 1);
assert.equal(Levenshtein.get("maron", "maroon"), 1);
assert.equal(Levenshtein.get("moon", "maroon"), 2);
assert.equal(Levenshtein.get("will", "wilt"), 1);
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"detectrtc": "1.4.0",
"eonasdan-bootstrap-datetimepicker": "4.17.49",
"exports-loader": "5.0.0",
"fast-levenshtein": "2.0.6",
"fast-levenshtein": "3.0.0",
"htmx.org": "2.0.3",
"intl-tel-input": "25.3.0",
"jquery": "3.5.1",
Expand Down
11 changes: 9 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3619,7 +3619,14 @@ fast-json-stable-stringify@^2.0.0:
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==

[email protected], fast-levenshtein@^2.0.6:
[email protected]:
version "3.0.0"
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-3.0.0.tgz#37b899ae47e1090e40e3fd2318e4d5f0142ca912"
integrity sha512-hKKNajm46uNmTlhHSyZkmToAc56uZJwYq7yrciZjqOxnlfQwERDQJmHPUp7m1m9wx8vgOe8IaCKZ5Kv2k1DdCQ==
dependencies:
fastest-levenshtein "^1.0.7"

fast-levenshtein@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
Expand All @@ -3629,7 +3636,7 @@ fast-uri@^3.0.1:
resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.1.tgz#cddd2eecfc83a71c1be2cc2ef2061331be8a7134"
integrity sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==

fastest-levenshtein@^1.0.12, fastest-levenshtein@^1.0.16:
fastest-levenshtein@^1.0.12, fastest-levenshtein@^1.0.16, fastest-levenshtein@^1.0.7:
version "1.0.16"
resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5"
integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==
Expand Down

0 comments on commit 2390642

Please sign in to comment.