Files
twenty/packages/twenty-front/src/utils/validation-schemas/camelCaseStringSchema.ts
Thaïs a9f4a66c4f refactor: validate objectMetadataItem with Zod on creation and update… (#4270)
* refactor: validate objectMetadataItem with Zod on creation and update & remove logic from useObjectMetadataItemForSettings

* refactor: review
2024-03-05 11:32:30 +01:00

9 lines
220 B
TypeScript

import camelCase from 'lodash.camelcase';
import { z } from 'zod';
export const camelCaseStringSchema = z
.string()
.refine((value) => camelCase(value) === value, {
message: 'String should be camel case',
});