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

Function formatMetricDescription

src/renderer/utils/notifications/formatters.ts:145–157  ·  view source on GitHub ↗
(
  count: number,
  singular: string,
  formatter?: (count: number, noun: string) => string,
)

Source from the content-addressed store, hash-verified

143 * @returns The formatted description string, or `""` when `count` is falsy.
144 */
145export function formatMetricDescription(
146 count: number,
147 singular: string,
148 formatter?: (count: number, noun: string) => string,
149) {
150 if (!count) {
151 return '';
152 }
153
154 const noun = count === 1 ? singular : `${singular}s`;
155
156 return formatter ? formatter(count, noun) : `${count} ${noun}`;
157}

Callers 3

LinkedIssuesPillFunction · 0.90
CommentsPillFunction · 0.90
formatters.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected