Repository navigation
fix[deburr]: only deburr Latin letters like lodash - #2123
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
raon0211
approved these changes
Sep 30, 2026
This branch was successfully deployed
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
Compat
deburrapplies NFD normalization to the entire string, while Lodash replaces letters in U+00C0–U+017F and removes combining marks without normalizing the string. This decomposes Hangul syllables and alters Cyrillic and Vietnamese text, also affecting the six compat case-conversion functions. The following calls compile in strict mode with@types/lodash.Changes
es-toolkitimplementation unchanged.normalize()on each invocation.camelCase,kebabCase,lowerCase,snakeCase,startCase, andupperCasethrough their existing compatdeburrimports.deburr.spec.ts,kebabCase.spec.ts, andcamelCase.spec.tsthat fail onmainand pass on this branch.camelCasebundle-size snapshot from 2,161 to 2,471 bytes (+310 bytes).Comparing all 194,560 non-surrogate code points in U+0000–U+2FFFF against Lodash found zero mismatches on this branch, down from 13,088 on
main.Unlike the NFC recomposition approach in #1905, this preserves characters whose combining marks would otherwise be removed.
Benchmark results
Measured on Windows with Node.js 22, alternating
mainand this branch in the same benchmark file; values are ops/sec (higher is better). Equivalent cases were run withvitest benchusing directsrc/compatimports because the benchmarks workspace failed withERR_UNSUPPORTED_ESM_URL_SCHEME.deburr('déjà vu, Ærøskøbing')deburr('hello world foo bar')(ASCII)kebabCase('Foo Bar déjà vu')