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

Function formatForDisplay

src/renderer/utils/notifications/formatters.ts:44–56  ·  view source on GitHub ↗
(text: string[])

Source from the content-addressed store, hash-verified

42 * @returns The formatted, human-readable string.
43 */
44export function formatForDisplay(text: string[]): string {
45 if (!text) {
46 return '';
47 }
48
49 return formatProperCase(
50 text
51 .join(' ')
52 .replace(/([a-z])([A-Z])/g, '$1 $2') // Add space between lowercase character followed by an uppercase character
53 .replaceAll('_', ' ') // Replace underscores with spaces
54 .trim(),
55 );
56}
57
58/**
59 * Formats a string to proper case (capitalize the first letter of each word).

Callers 2

formatters.test.tsFile · 0.90
formatNotificationTypeFunction · 0.85

Calls 1

formatProperCaseFunction · 0.85

Tested by

no test coverage detected