next-enterprise/components/Form/Utils.ts
2024-03-03 22:09:33 -05:00

10 lines
295 B
TypeScript

export class Utils {
//Function to convert strings to camel case
static camelize = (str: string) => {
return str
.replace(/(?:^\w|[A-Z]|\b\w)/g, function (word, index) {
return index === 0 ? word.toLowerCase() : word.toUpperCase()
})
.replace(/\s+/g, "")
}
}