@parcel/utils
Advanced tools
Comparing version 2.0.0-nightly.351 to 2.0.0-nightly.352
@@ -11,3 +11,3 @@ "use strict"; | ||
var _jsLevenshtein = _interopRequireDefault(require("js-levenshtein")); | ||
var _fastestLevenshtein = _interopRequireDefault(require("fastest-levenshtein")); | ||
@@ -248,3 +248,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function fuzzySearch(expectedValues, actualValue) { | ||
let result = expectedValues.map(exp => [exp, (0, _jsLevenshtein.default)(exp, actualValue)]).filter( // Remove if more than half of the string would need to be changed | ||
let result = expectedValues.map(exp => [exp, _fastestLevenshtein.default.distance(exp, actualValue)]).filter( // Remove if more than half of the string would need to be changed | ||
([, d]) => d * 2 < actualValue.length); | ||
@@ -251,0 +251,0 @@ result.sort(([, a], [, b]) => a - b); |
{ | ||
"name": "@parcel/utils", | ||
"version": "2.0.0-nightly.351+5be013a0", | ||
"version": "2.0.0-nightly.352+11e5a321", | ||
"description": "Blazing fast, zero configuration web application bundler", | ||
@@ -24,6 +24,6 @@ "license": "MIT", | ||
"@iarna/toml": "^2.2.0", | ||
"@parcel/codeframe": "2.0.0-nightly.351+5be013a0", | ||
"@parcel/diagnostic": "2.0.0-nightly.351+5be013a0", | ||
"@parcel/logger": "2.0.0-nightly.351+5be013a0", | ||
"@parcel/markdown-ansi": "2.0.0-nightly.351+5be013a0", | ||
"@parcel/codeframe": "2.0.0-nightly.352+11e5a321", | ||
"@parcel/diagnostic": "2.0.0-nightly.352+11e5a321", | ||
"@parcel/logger": "2.0.0-nightly.352+11e5a321", | ||
"@parcel/markdown-ansi": "2.0.0-nightly.352+11e5a321", | ||
"@parcel/source-map": "2.0.0-alpha.4.13", | ||
@@ -34,5 +34,5 @@ "ansi-html": "^0.0.7", | ||
"fast-glob": "3.1.1", | ||
"fastest-levenshtein": "^1.0.8", | ||
"is-glob": "^4.0.0", | ||
"is-url": "^1.2.2", | ||
"js-levenshtein": "^1.1.6", | ||
"json5": "^1.0.1", | ||
@@ -51,3 +51,3 @@ "micromatch": "^4.0.2", | ||
}, | ||
"gitHead": "5be013a0b6facd714f6a2ff75e52d945a07df5a5" | ||
"gitHead": "11e5a321b7fd48aecca83db8adb5dcf1b1a5aa75" | ||
} |
@@ -6,3 +6,3 @@ // @flow strict-local | ||
// flowlint-next-line untyped-import:off | ||
import levenshteinDistance from 'js-levenshtein'; | ||
import levenshtein from 'fastest-levenshtein'; | ||
@@ -371,3 +371,3 @@ export type SchemaEntity = | ||
let result = expectedValues | ||
.map(exp => [exp, levenshteinDistance(exp, actualValue)]) | ||
.map(exp => [exp, levenshtein.distance(exp, actualValue)]) | ||
.filter( | ||
@@ -374,0 +374,0 @@ // Remove if more than half of the string would need to be changed |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
154314
+ Addedfastest-levenshtein@^1.0.8
+ Addedfastest-levenshtein@1.0.16(transitive)
- Removedjs-levenshtein@^1.1.6
- Removedjs-levenshtein@1.1.6(transitive)