Repository navigation
fix[startCase]: only uppercase the first letter of each word like lodash - #2160
Merged
Merged
Conversation
`startCase` lowercased the rest of every word that was not all uppercase. Since #2097, `words` keeps camel humps in non-Latin scripts together like lodash, so `startCase('ПриветМир')` turned into `'Приветмир'` instead of lodash's `'ПриветМир'`. lodash only applies `upperFirst` to each word, and it does so by code point. Do the same, so astral first letters such as `'𐐨'` are uppercased too.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
startCaselowercased the rest of every word that was not all uppercase. Since #2097,wordskeeps camel humps in non-Latin scripts together like lodash, sostartCase('ПриветМир')became'Приветмир'instead of lodash's'ПриветМир'. lodash only appliesupperFirstto each word, by code point.Changes
'𐐨𐐩 deseret'→'𐐀 𐐁 Deseret').Over 111,189 generated strings,
maindiffers from lodash in 9,317 and v1.52.0 in 93,340. This PR differs in none. The bundle grows by 7 B.