(text: string)
| 62 | * @returns The proper-cased string. |
| 63 | */ |
| 64 | export function formatProperCase(text: string) { |
| 65 | if (!text) { |
| 66 | return ''; |
| 67 | } |
| 68 | |
| 69 | return text.replace(/\w+/g, (word) => { |
| 70 | // Convert to proper case (capitalize first letter of each word) |
| 71 | return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); |
| 72 | }); |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Return the formatted notification type for this notification. |
no outgoing calls
no test coverage detected