/**
 * Capitalize the first letter of every word, preserving the rest of each
 * word so acronyms (MGM, SAFL, Pvt, Ltd) keep their existing casing.
 *
 *   "about us"        -> "About Us"
 *   "about SAFL"      -> "About SAFL"
 *   "rides & attractions" -> "Rides & Attractions"
 *   "MGM Charitable Trust" -> "MGM Charitable Trust"
 */
export function titleCase(input: string): string {
  if (!input) return input
  return input
    .split(/\s+/)
    .map((w) => (w ? w.charAt(0).toUpperCase() + w.slice(1) : w))
    .join(" ")
}
