// Capitalize first letter of each word export const capitalize = (str: string): string => str.replace( /\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.slice(1).toLowerCase(), );