You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The regular expressions in this package don’t support unicode characters such as àçéèù so camelCase("Licorne époustouflante") outputs licorne époustouflante.
Perhaps we could add a transliterate option that leverages transliterate so camelCase("Licorne époustouflante", { transliterate: true }) outputs licorneEpoustouflante.
Another slightly more complicated alternative would be to have camelCase("Licorne époustouflante", { transliterate: true }) output licorneÉpoustouflante.
What do you think? I could put a PR together.
The text was updated successfully, but these errors were encountered:
sindresorhus
changed the title
Adding a transliterate option to convert and camel case unicode characters
Correctly handle Unicode characters
Mar 4, 2020
@sunknudsen / @sindresorhus I've put up a fix for this (see☝️, PR #62) which employs Unicode property escapes as suggested.
You can test whether it works for your use case by running npm install sverweij/camelcase. This will install it directly from the forked repo on github - the code will live there only until it's merged into this repo. Or when a better fix comes along, of course :-)
The regular expressions in this package don’t support unicode characters such as
àçéèù
socamelCase("Licorne époustouflante")
outputslicorne époustouflante
.Perhaps we could add a
transliterate
option that leverages transliterate socamelCase("Licorne époustouflante", { transliterate: true })
outputslicorneEpoustouflante
.Another slightly more complicated alternative would be to have
camelCase("Licorne époustouflante", { transliterate: true })
outputlicorneÉpoustouflante
.What do you think? I could put a PR together.
The text was updated successfully, but these errors were encountered: