Skip to content

Commit 2617303

Browse files
sinankeskinbcoe
andauthored
fix(locale): Turkish camelize and decamelize issues with toLocaleLowerCase/toLocaleUpperCase
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
1 parent efcc32c commit 2617303

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/string-utils.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function camelCase (str: string): string {
1010
const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase()
1111

1212
if (!isCamelCase) {
13-
str = str.toLocaleLowerCase()
13+
str = str.toLowerCase()
1414
}
1515

1616
if (str.indexOf('-') === -1 && str.indexOf('_') === -1) {
@@ -23,7 +23,7 @@ export function camelCase (str: string): string {
2323
let chr = str.charAt(i)
2424
if (nextChrUpper) {
2525
nextChrUpper = false
26-
chr = chr.toLocaleUpperCase()
26+
chr = chr.toUpperCase()
2727
}
2828
if (i !== 0 && (chr === '-' || chr === '_')) {
2929
nextChrUpper = true
@@ -36,7 +36,7 @@ export function camelCase (str: string): string {
3636
}
3737

3838
export function decamelize (str: string, joinString?: string): string {
39-
const lowercase = str.toLocaleLowerCase()
39+
const lowercase = str.toLowerCase()
4040
joinString = joinString || '-'
4141
let notCamelcase = ''
4242
for (let i = 0; i < str.length; i++) {

0 commit comments

Comments
 (0)