refactor(case converter): no split on lowercase, uppercase and mocking case

This commit is contained in:
Corentin Thomasset 2023-11-13 00:50:24 +01:00
parent 16ffe6b5c9
commit 498c04df32
No known key found for this signature in database
GPG key ID: DBD997E935996158

View file

@ -23,11 +23,11 @@ const input = ref('lorem ipsum dolor sit amet');
const formats = computed(() => [
{
label: 'Lowercase:',
value: noCase(input.value, baseConfig).toLocaleLowerCase(),
value: input.value.toLocaleLowerCase(),
},
{
label: 'Uppercase:',
value: noCase(input.value, baseConfig).toLocaleUpperCase(),
value: input.value.toLocaleUpperCase(),
},
{
label: 'Camelcase:',
@ -75,7 +75,7 @@ const formats = computed(() => [
},
{
label: 'Mockingcase:',
value: noCase(input.value, baseConfig)
value: input.value
.split('')
.map((char, index) => (index % 2 === 0 ? char.toUpperCase() : char.toLowerCase()))
.join(''),