Files
twenty/packages/twenty-server/src/utils/camel-to-title-case.ts
Thomas Trompette 41960f3593 Remote objects: Fix comment override - id typing - label (#4784)
Several fixes for remote objects:
- labels are now displayed in title case. Added an util for this.
- Ids are often integers but the foreign keys on the relations were
uuid. Sending the id type to the object metadata service so it can
creates the foreign key accordingly
- Graphql comments are override when several remote objects are
imported. Building a function that fetch the existing comment and update
it

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
2024-04-04 15:35:49 +02:00

7 lines
219 B
TypeScript

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