From 261730383e02448562f737b94bbd1f164aed5143 Mon Sep 17 00:00:00 2001 From: Sinan Keskin Date: Sun, 20 Jun 2021 20:13:47 +0300 Subject: [PATCH] fix(locale): Turkish camelize and decamelize issues with toLocaleLowerCase/toLocaleUpperCase Co-authored-by: Benjamin E. Coe --- lib/string-utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/string-utils.ts b/lib/string-utils.ts index 9c52197d..5932a4c7 100644 --- a/lib/string-utils.ts +++ b/lib/string-utils.ts @@ -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) { @@ -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 @@ -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++) {