chore: replace fastest-levenshtein with turbo-leven in did-you-mean#9243
Open
dev-kjma wants to merge 1 commit intonpm:latestfrom
Open
chore: replace fastest-levenshtein with turbo-leven in did-you-mean#9243dev-kjma wants to merge 1 commit intonpm:latestfrom
dev-kjma wants to merge 1 commit intonpm:latestfrom
Conversation
turbo-leven is a superset of fastest-levenshtein: - Exports .distance(a,b) — the exact same API used here - Zero required dependencies with a pure-JS fallback - Optional Rust native module (9.4x faster on long strings, 1.3x on medium) - Ships TypeScript types - Better Unicode: counts codepoints not UTF-16 code units The change is surgical: one require() in did-you-mean.js + package.json dep.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces
fastest-levenshteinwithturbo-leveninlib/utils/did-you-mean.js.turbo-levenexports.distance(a, b)— the exact API already used here — so the call site inisClose()is unchanged. Only therequire()andpackage.jsondep are modified.Why
turbo-levenis a strict superset offastest-levenshtein:fastest-levenshteinturbo-leven.distance(a, b).get(a, b)The Rust native module is optional —
turbo-levenships a pure-JS fallback that activates silently on any platform where native loading fails. No build toolchain or Rust required for end users.Changes
No other changes.
Benchmark / correctness source
https://github.com/dev-kjma/faster-levenshtein