@italia-tools/faker
Version:
Italian-specific fake data generator based on Faker.js
16 lines (14 loc) • 404 B
JavaScript
class NameUtils {
/**
* Formats an Italian name to capitalize the first letter of each word
* @param fullName The full name to format
* @returns The formatted name
*/
static formatItalianName(fullName) {
return fullName.toLowerCase()
.split(' ')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
}
}
export { NameUtils };