refactor: implement toCamelCase utility function and update quotation stats mapping

This commit is contained in:
puriphatt 2025-02-20 09:28:42 +07:00
parent 5e3c04be8e
commit 4f085e068a
2 changed files with 10 additions and 1 deletions

View file

@ -609,3 +609,9 @@ export function getEmployeeName(
['tha']: `${typeof employee.namePrefix === 'string' ? useOptionStore().mapOption(employee.namePrefix) : ''} ${employee.firstName} ${employee.lastName}`,
}[opts?.locale || 'eng'];
}
export function toCamelCase(text: string): string {
return text
.replace(/[^a-zA-Z0-9]+(.)/g, (match, chr) => chr.toUpperCase())
.replace(/^[A-Z]/, (match) => match.toLowerCase());
}