MCPcopy Index your code
hub / github.com/gitify-app/gitify / formatProperCase

Function formatProperCase

src/renderer/utils/notifications/formatters.ts:64–73  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

62 * @returns The proper-cased string.
63 */
64export 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.

Callers 2

formatters.test.tsFile · 0.90
formatForDisplayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected