Skip to content

Commit

Permalink
fix(locale): Turkish camelize and decamelize issues with toLocaleLowe…
Browse files Browse the repository at this point in the history
…rCase/toLocaleUpperCase

Co-authored-by: Benjamin E. Coe <bencoe@google.com>
  • Loading branch information
sinankeskin and bcoe authored Jun 20, 2021
1 parent efcc32c commit 2617303
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/string-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function camelCase (str: string): string {
const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase()

if (!isCamelCase) {
str = str.toLocaleLowerCase()
str = str.toLowerCase()
}

if (str.indexOf('-') === -1 && str.indexOf('_') === -1) {
Expand All @@ -23,7 +23,7 @@ export function camelCase (str: string): string {
let chr = str.charAt(i)
if (nextChrUpper) {
nextChrUpper = false
chr = chr.toLocaleUpperCase()
chr = chr.toUpperCase()
}
if (i !== 0 && (chr === '-' || chr === '_')) {
nextChrUpper = true
Expand All @@ -36,7 +36,7 @@ export function camelCase (str: string): string {
}

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

0 comments on commit 2617303

Please sign in to comment.