Files
calendar/packages/lib/getValidRhfFieldName.ts
T
6529b49c3c feat: bookingFields identifier supports - and _ characters (#16353)
* now bookingFields identifier supports - and _ characters but no special characters

* fix: unit test

---------

Co-authored-by: Amit Sharma <74371312+Amit91848@users.noreply.github.com>
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
2024-08-26 12:15:02 +02:00

6 lines
414 B
TypeScript

export const getValidRhfFieldName = (fieldName: string) => {
// Remember that any transformation that you do here would run on System Field names as well. So, be careful and avoiding doing anything here that would modify the SystemField names.
// e.g. SystemField name currently have uppercases in them. So, no need to lowercase unless absolutely needed.
return fieldName.replace(/[^a-zA-Z0-9-_]/g, "-");
};