diff --git a/package-lock.json b/package-lock.json index 638ae613..d130dfa1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@fortawesome/free-solid-svg-icons": "^6.4.2", "@fortawesome/react-fontawesome": "^0.2.0", "@foxxmd/chromecast-client": "^1.0.4", - "@foxxmd/string-sameness": "^0.2.0", + "@foxxmd/string-sameness": "^0.4.0", "@foxxmd/winston": "3.3.31", "@kenyip/backoff-strategies": "^1.0.4", "@react-nano/use-event-source": "^0.13.0", @@ -1469,12 +1469,12 @@ } }, "node_modules/@foxxmd/string-sameness": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@foxxmd/string-sameness/-/string-sameness-0.2.0.tgz", - "integrity": "sha512-b4at6spxVej3IfZA1fVBX1iGZ4UdcEJSXItv89lV2ZNtJOYvShc39gUAyDrtRbrz9yilEvSggyyKKLmC0BXXxg==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@foxxmd/string-sameness/-/string-sameness-0.4.0.tgz", + "integrity": "sha512-6O2A+VpmUYiQMtFVfBQHtrbinN7JqRKwUUgBDpAR7nVrYtjFCJSsj8DC2rFLiY81bW9o7FRU6SIuVOoRfBW2pw==", "dependencies": { - "leven": "^3.0.0", - "string-similarity": "^4.0.4" + "dice-coefficient": "^2.1.1", + "leven": "^3.0.0" }, "engines": { "node": ">=18.0.0", @@ -4093,6 +4093,21 @@ "wrappy": "1" } }, + "node_modules/dice-coefficient": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/dice-coefficient/-/dice-coefficient-2.1.1.tgz", + "integrity": "sha512-vPTcHmOQAuGvU6eyBtj7QCBwDJh2I7QpbBU51lbgfv7592KjBl6dm0baRBSh9ekt2X91MNAz7OpJrXCIUtDzlw==", + "dependencies": { + "n-gram": "^2.0.0" + }, + "bin": { + "dice-coefficient": "cli.js" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/didyoumean": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", @@ -6796,6 +6811,15 @@ "thenify-all": "^1.0.0" } }, + "node_modules/n-gram": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/n-gram/-/n-gram-2.0.2.tgz", + "integrity": "sha512-S24aGsn+HLBxUGVAUFOwGpKs7LBcG4RudKU//eWzt/mQ97/NMKQxDWHyHx63UNWk/OOdihgmzoETn1tf5nQDzQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/nanoid": { "version": "3.3.7", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", @@ -9043,12 +9067,6 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/string-similarity": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.4.tgz", - "integrity": "sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ==", - "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info." - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", diff --git a/package.json b/package.json index 3d4bf03a..8e30fd22 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@fortawesome/free-solid-svg-icons": "^6.4.2", "@fortawesome/react-fontawesome": "^0.2.0", "@foxxmd/chromecast-client": "^1.0.4", - "@foxxmd/string-sameness": "^0.2.0", + "@foxxmd/string-sameness": "^0.4.0", "@foxxmd/winston": "3.3.31", "@kenyip/backoff-strategies": "^1.0.4", "@react-nano/use-event-source": "^0.13.0", diff --git a/src/backend/tests/utils/strings.test.ts b/src/backend/tests/utils/strings.test.ts index 1ba15949..a0693691 100644 --- a/src/backend/tests/utils/strings.test.ts +++ b/src/backend/tests/utils/strings.test.ts @@ -111,7 +111,7 @@ describe('String Comparisons', function () { for(const test of tests) { const result = compareNormalizedStrings(test[0], test[1]); - assert.isAtMost( result.highScore, 53, `Comparing: '${test[0]}' | '${test[1]}'`); + assert.isAtMost( result.highScore, 58, `Comparing: '${test[0]}' | '${test[1]}'`); } });