( notification: GitifyNotification, )
| 11 | * @returns The notification with populated display property |
| 12 | */ |
| 13 | export function formatNotification( |
| 14 | notification: GitifyNotification, |
| 15 | ): GitifyNotification { |
| 16 | const handler = createNotificationHandler(notification); |
| 17 | |
| 18 | return { |
| 19 | ...notification, |
| 20 | display: { |
| 21 | type: formatNotificationType(notification), |
| 22 | number: formatNotificationNumber(notification), |
| 23 | title: formatNotificationTitle(notification), |
| 24 | icon: { |
| 25 | type: handler.iconType(notification), |
| 26 | color: handler.iconColor(notification), |
| 27 | }, |
| 28 | defaultUserType: handler.defaultUserType(), |
| 29 | }, |
| 30 | }; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Normalise an array of text segments into a single display-ready string. |
no test coverage detected