MCPcopy Create free account
hub / github.com/ArrowM/Queue-Bot / timeMention

Function timeMention

src/utils/string.utils.ts:91–109  ·  view source on GitHub ↗
(seconds: number)

Source from the content-addressed store, hash-verified

89}
90
91export 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
111export function propertyMention(propertName: string) {
112 return bold(convertCamelCaseToTitleCase(propertName));

Callers 2

buildDescriptionFunction · 0.90
insertJsMemberFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected