diff --git a/src/string.ts b/src/string.ts index fe788032..77140f91 100644 --- a/src/string.ts +++ b/src/string.ts @@ -101,7 +101,7 @@ export const pascal = (str: string): string => { * title('ABC_content') -> 'Abc Content' */ export const title = (str: string | null | undefined): string => { - if (!str) return ''; + if (!str) return '' return str .split(/(?=[A-Z][a-z])|[\.\-\s_]/) @@ -110,11 +110,11 @@ export const title = (str: string | null | undefined): string => { .map(s => { if (s === s.toUpperCase()) { // If the entire string segment is uppercase, capitalize it properly - return capitalize(s.toLowerCase()); + return capitalize(s.toLowerCase()) } - return capitalize(s); + return capitalize(s) }) - .join(' '); + .join(' ') } /**