(seconds: number)
| 89 | } |
| 90 | |
| 91 | export function timeMention(seconds: number) { |
| 92 | seconds = Number(seconds); |
| 93 | const numMinutes = Math.floor(seconds / 60); |
| 94 | const numSecondsRemainder = seconds % 60; |
| 95 | let str = ""; |
| 96 | |
| 97 | if (numMinutes > 0) { |
| 98 | str += `${bold(String(numMinutes))} minute${numMinutes === 1 ? "" : "s"}`; |
| 99 | if (numSecondsRemainder > 0) { |
| 100 | str += " and "; |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | if (numMinutes === 0 || numSecondsRemainder > 0) { |
| 105 | str += `${bold(String(numSecondsRemainder))} second${numSecondsRemainder === 1 ? "" : "s"}`; |
| 106 | } |
| 107 | |
| 108 | return str; |
| 109 | } |
| 110 | |
| 111 | export function propertyMention(propertName: string) { |
| 112 | return bold(convertCamelCaseToTitleCase(propertName)); |
no outgoing calls
no test coverage detected