Move capitalize into twenty-shared (#9414)
capitalize had been moved into twenty-shared. Let's remove the duplicates in server and front !
This commit is contained in:
@ -1,11 +0,0 @@
|
||||
import { capitalize } from '../capitalize';
|
||||
|
||||
describe('capitalize', () => {
|
||||
it('should capitalize a string', () => {
|
||||
expect(capitalize('test')).toBe('Test');
|
||||
});
|
||||
|
||||
it('should return an empty string if input is an empty string', () => {
|
||||
expect(capitalize('')).toBe('');
|
||||
});
|
||||
});
|
||||
@ -1,7 +0,0 @@
|
||||
import { isNonEmptyString } from '@sniptt/guards';
|
||||
|
||||
export const capitalize = (stringToCapitalize: string) => {
|
||||
if (!isNonEmptyString(stringToCapitalize)) return '';
|
||||
|
||||
return stringToCapitalize[0].toUpperCase() + stringToCapitalize.slice(1);
|
||||
};
|
||||
@ -1,5 +1,5 @@
|
||||
import camelCase from 'lodash.camelcase';
|
||||
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const pascalCase = (str: string) => capitalize(camelCase(str));
|
||||
|
||||
Reference in New Issue
Block a user