Files
twenty/packages/twenty-server/src/utils/camel-to-title-case.ts
Marie 7d7955fc65 Move capitalize into twenty-shared (#9414)
capitalize had been moved into twenty-shared. Let's remove the
duplicates in server and front !
2025-01-07 14:25:29 +00:00

7 lines
212 B
TypeScript

import { capitalize } from 'twenty-shared';
export const camelToTitleCase = (camelCaseText: string) =>
capitalize(camelCaseText)
.replace(/([A-Z])/g, ' $1')
.replace(/^./, (str) => str.toUpperCase());