From 21d2ed5b623d16b03ff0dfea19660592b6f741c0 Mon Sep 17 00:00:00 2001 From: "yuting2.liu" Date: Tue, 10 Dec 2024 17:17:40 +0800 Subject: [PATCH] feat: format --- src/string.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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(' ') } /**